Documentation ¶
Overview ¶
Copyright Contributors to the Open Cluster Management project
Copyright Contributors to the Open Cluster Management project
Index ¶
- Constants
- func FuncMap() template.FuncMap
- func GenericFuncMap() map[string]interface{}
- func IsEmptyAsset(err error) bool
- func NewResourceCache() resourceapply.ResourceCache
- func TemplateFuncMap(tmpl *template.Template) (funcMap template.FuncMap)
- func WriteOutput(fileName string, output []string) (err error)
- type Applier
- func (a *Applier) ApplyCustomResource(reader asset.ScenarioReader, values interface{}, dryRun bool, ...) (string, error)
- func (a *Applier) ApplyCustomResources(reader asset.ScenarioReader, values interface{}, dryRun bool, ...) ([]string, error)
- func (a *Applier) ApplyDeployment(reader asset.ScenarioReader, values interface{}, dryRun bool, ...) (string, error)
- func (a *Applier) ApplyDeployments(reader asset.ScenarioReader, values interface{}, dryRun bool, ...) ([]string, error)
- func (a *Applier) ApplyDirectly(reader asset.ScenarioReader, values interface{}, dryRun bool, ...) ([]string, error)
- func (a *Applier) GetCache() resourceapply.ResourceCache
- func (a *Applier) MustTemplateAsset(reader asset.ScenarioReader, values interface{}, headerFile, name string) ([]byte, error)
- func (a *Applier) MustTemplateAssets(reader asset.ScenarioReader, values interface{}, headerFile string, ...) ([]string, error)
- type ApplierBuilder
- func (a *ApplierBuilder) Build() Applier
- func (a *ApplierBuilder) GetAPIExtensionClient() apiextensionsclient.Interface
- func (a *ApplierBuilder) GetDynamicClient() dynamic.Interface
- func (a *ApplierBuilder) GetKubeClient() kubernetes.Interface
- func (a *ApplierBuilder) WithCache(cache resourceapply.ResourceCache) *ApplierBuilder
- func (a *ApplierBuilder) WithClient(kubeClient kubernetes.Interface, ...) *ApplierBuilder
- func (a *ApplierBuilder) WithContext(ctx context.Context) *ApplierBuilder
- func (a *ApplierBuilder) WithOwner(owner runtime.Object, blockOwnerDeletion, controller bool, ...) *ApplierBuilder
- func (a *ApplierBuilder) WithTemplateFuncMap(fm template.FuncMap) *ApplierBuilder
Constants ¶
const (
ErrorEmptyAssetAfterTemplating = "ERROR_EMPTY_ASSET_AFTER_TEMPLATING"
)
Variables ¶
This section is empty.
Functions ¶
func GenericFuncMap ¶
func GenericFuncMap() map[string]interface{}
GenericFuncMap returns a copy of the basic function map as a map[string]interface{}.
func IsEmptyAsset ¶
IsEmptyAsset returns true if the error is ErrorEmptyAssetAfterTemplating
func NewResourceCache ¶ added in v0.3.0
func NewResourceCache() resourceapply.ResourceCache
func TemplateFuncMap ¶
TemplateFuncMap generates function map for "include"
func WriteOutput ¶
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 (*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
func (a *ApplierBuilder) WithCache(cache resourceapply.ResourceCache) *ApplierBuilder
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.