apply

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Copyright Contributors to the Open Cluster Management project

Copyright Contributors to the Open Cluster Management project

Index

Constants

View Source
const (
	ErrorEmptyAssetAfterTemplating = "ERROR_EMPTY_ASSET_AFTER_TEMPLATING"
)

Variables

This section is empty.

Functions

func FuncMap

func FuncMap() template.FuncMap

ApplierFuncMap adds the function map

func GenericFuncMap

func GenericFuncMap() map[string]interface{}

GenericFuncMap returns a copy of the basic function map as a map[string]interface{}.

func IsEmptyAsset

func IsEmptyAsset(err error) bool

IsEmptyAsset returns true if the error is ErrorEmptyAssetAfterTemplating

func NewResourceCache added in v0.3.0

func NewResourceCache() resourceapply.ResourceCache

func TemplateFuncMap

func TemplateFuncMap(tmpl *template.Template) (funcMap template.FuncMap)

TemplateFuncMap generates function map for "include"

func WriteOutput

func WriteOutput(fileName string, output []string) (err error)

Types

type Applier

type Applier struct {
	// contains filtered or unexported fields
}

func (*Applier) ApplyCustomResource

func (a *Applier) ApplyCustomResource(
	reader asset.ScenarioReader,
	values interface{},
	dryRun bool,
	headerFile string,
	name string) (string, error)

ApplyCustomResource applies a custom resource

func (*Applier) ApplyCustomResources

func (a *Applier) ApplyCustomResources(
	reader asset.ScenarioReader,
	values interface{},
	dryRun bool,
	headerFile string,
	files ...string) ([]string, error)

ApplyCustomResources applies custom resources

func (*Applier) ApplyDeployment

func (a *Applier) ApplyDeployment(
	reader asset.ScenarioReader,
	values interface{},
	dryRun bool,
	headerFile string,
	name string) (string, error)

ApplyDeployment apply a deployment

func (*Applier) ApplyDeployments

func (a *Applier) ApplyDeployments(
	reader asset.ScenarioReader,
	values interface{},
	dryRun bool,
	headerFile string,
	files ...string) ([]string, error)

ApplyDeployments applies a appsv1.Deployment template

func (*Applier) ApplyDirectly

func (a *Applier) ApplyDirectly(
	reader asset.ScenarioReader,
	values interface{},
	dryRun bool,
	headerFile string,
	files ...string) ([]string, error)

ApplyDirectly applies standard kubernetes resources.

func (*Applier) GetCache added in v0.3.0

func (a *Applier) GetCache() resourceapply.ResourceCache

func (*Applier) MustTemplateAsset added in v0.2.0

func (a *Applier) MustTemplateAsset(reader asset.ScenarioReader, values interface{}, headerFile, name string) ([]byte, error)

MustTemplateAsset generates textual output for a template file name. The headerfile will be added to each file. Usually it contains nested template definitions as described https://golang.org/pkg/text/template/#hdr-Nested_template_definitions This allows to add functions which can be use in each file. The values object will be used to render the template

func (*Applier) MustTemplateAssets

func (a *Applier) MustTemplateAssets(reader asset.ScenarioReader, values interface{}, headerFile string, files ...string) ([]string, error)

MustTemplateAssets render list of files

type ApplierBuilder

type ApplierBuilder struct {
	// contains filtered or unexported fields
}

ApplierBuilder a builder to build the applier

func NewApplierBuilder added in v0.3.0

func NewApplierBuilder() *ApplierBuilder

New ApplyBuilder

func (*ApplierBuilder) Build

func (a *ApplierBuilder) Build() Applier

Build returns the builded applier

func (*ApplierBuilder) GetAPIExtensionClient added in v0.3.0

func (a *ApplierBuilder) GetAPIExtensionClient() apiextensionsclient.Interface

func (*ApplierBuilder) GetDynamicClient added in v0.3.0

func (a *ApplierBuilder) GetDynamicClient() dynamic.Interface

func (*ApplierBuilder) GetKubeClient added in v0.3.0

func (a *ApplierBuilder) GetKubeClient() kubernetes.Interface

func (*ApplierBuilder) WithCache added in v0.3.0

WithCache set a the cache instead of using the default cache created on the Build()

func (*ApplierBuilder) WithClient

func (a *ApplierBuilder) WithClient(
	kubeClient kubernetes.Interface,
	apiExtensionsClient apiextensionsclient.Interface,
	dynamicClient dynamic.Interface) *ApplierBuilder

WithClient adds the several clients to the applier

func (*ApplierBuilder) WithContext added in v0.3.0

func (a *ApplierBuilder) WithContext(ctx context.Context) *ApplierBuilder

WithContext set a the cache instead of using the default cache created on the Build()

func (*ApplierBuilder) WithOwner

func (a *ApplierBuilder) WithOwner(owner runtime.Object, blockOwnerDeletion, controller bool, scheme *runtime.Scheme) *ApplierBuilder

WithOwner add an ownerref to the object

func (*ApplierBuilder) WithTemplateFuncMap

func (a *ApplierBuilder) WithTemplateFuncMap(fm template.FuncMap) *ApplierBuilder

WithTemplateFuncMap add template.FuncMap to the applier.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL