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 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) MustTempalteAsset(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) WithClient(kubeClient kubernetes.Interface, ...) *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 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) MustTempalteAsset ¶
func (a *Applier) MustTempalteAsset(reader asset.ScenarioReader, values interface{}, headerFile, name string) ([]byte, error)
MustTempalteAsset 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 {
Applier
}
ApplierBuilder a builder to build the applier
func (*ApplierBuilder) Build ¶
func (a *ApplierBuilder) Build() Applier
Build returns the builded applier
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) 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.