Documentation ¶
Overview ¶
Copyright Red Hat
Copyright Red Hat ¶
Copyright Red Hat
Index ¶
- func FuncMap() template.FuncMap
- func GenericFuncMap() map[string]interface{}
- 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) Apply(reader asset.ScenarioReader, values interface{}, dryRun bool, ...) ([]string, error)
- 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) GetFileInfo(reader asset.ScenarioReader, values interface{}, headerFile string, ...) ([]FileInfo, error)
- 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)
- func (a *Applier) Sort(reader asset.ScenarioReader, values interface{}, headerFile string, ...) ([]string, error)
- func (a Applier) WithCache(cache resourceapply.ResourceCache) Applier
- func (a Applier) WithClient(kubeClient kubernetes.Interface, ...) Applier
- func (a Applier) WithContext(ctx context.Context) Applier
- func (a Applier) WithKindOrder(kindsOrder KindsOrder) Applier
- func (a Applier) WithOwner(owner runtime.Object, blockOwnerDeletion, controller bool, ...) Applier
- func (a Applier) WithRestConfig(cfg *rest.Config) Applier
- func (a Applier) WithTemplateFuncMap(fm template.FuncMap) Applier
- 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) WithKindOrder(kindsOrder KindsOrder) *ApplierBuilder
- func (a *ApplierBuilder) WithOwner(owner runtime.Object, blockOwnerDeletion, controller bool, ...) *ApplierBuilder
- func (a *ApplierBuilder) WithRestConfig(cfg *rest.Config) *ApplierBuilder
- func (a *ApplierBuilder) WithTemplateFuncMap(fm template.FuncMap) *ApplierBuilder
- type FileInfo
- type KindsOrder
Constants ¶
This section is empty.
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 NewResourceCache ¶
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 ¶
func (a Applier) GetCache() resourceapply.ResourceCache
func (*Applier) GetFileInfo ¶ added in v1.2.2
func (Applier) MustTemplateAsset ¶
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
func (Applier) WithCache ¶ added in v1.2.5
func (a Applier) WithCache(cache resourceapply.ResourceCache) Applier
WithCache set a the cache instead of using the default cache created on the Build()
func (Applier) WithClient ¶ added in v1.2.5
func (a Applier) WithClient( kubeClient kubernetes.Interface, apiExtensionsClient apiextensionsclient.Interface, dynamicClient dynamic.Interface) Applier
WithClient adds the several clients to the applier
func (Applier) WithContext ¶ added in v1.2.5
WithContext set a the cache instead of using the default cache created on the Build()
func (Applier) WithKindOrder ¶ added in v1.2.5
func (a Applier) WithKindOrder(kindsOrder KindsOrder) Applier
WithKindOrder defines the order in which the files must be applied.
func (Applier) WithOwner ¶ added in v1.2.5
func (a Applier) WithOwner(owner runtime.Object, blockOwnerDeletion, controller bool, scheme *runtime.Scheme) Applier
WithOwner add an ownerref to the object
func (Applier) WithRestConfig ¶ added in v1.2.5
WithRestConfig adds the clients based on the provided rest.Config
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 ¶
func (a *ApplierBuilder) GetAPIExtensionClient() apiextensionsclient.Interface
func (*ApplierBuilder) GetDynamicClient ¶
func (a *ApplierBuilder) GetDynamicClient() dynamic.Interface
func (*ApplierBuilder) GetKubeClient ¶
func (a *ApplierBuilder) GetKubeClient() kubernetes.Interface
func (*ApplierBuilder) WithCache ¶
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 ¶
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) WithKindOrder ¶ added in v1.2.2
func (a *ApplierBuilder) WithKindOrder(kindsOrder KindsOrder) *ApplierBuilder
WithKindOrder defines the order in which the files must be applied.
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) WithRestConfig ¶ added in v1.2.5
func (a *ApplierBuilder) WithRestConfig(cfg *rest.Config) *ApplierBuilder
WithRestConfig adds the clients based on the provided rest.Config
func (*ApplierBuilder) WithTemplateFuncMap ¶
func (a *ApplierBuilder) WithTemplateFuncMap(fm template.FuncMap) *ApplierBuilder
WithTemplateFuncMap add template.FuncMap to the applier.
type KindsOrder ¶ added in v1.2.2
type KindsOrder []string
KindsOrder ...
var DefaultCreateUpdateKindsOrder KindsOrder = []string{
"Namespace",
"NetworkPolicy",
"ResourceQuota",
"LimitRange",
"PodSecurityPolicy",
"PodDisruptionBudget",
"ServiceAccount",
"Secret",
"SecretList",
"ConfigMap",
"StorageClass",
"PersistentVolume",
"PersistentVolumeClaim",
"CustomResourceDefinition",
"ClusterRole",
"ClusterRoleList",
"ClusterRoleBinding",
"ClusterRoleBindingList",
"Role",
"RoleList",
"RoleBinding",
"RoleBindingList",
"Service",
"DaemonSet",
"Pod",
"ReplicationController",
"ReplicaSet",
"Deployment",
"HorizontalPodAutoscaler",
"StatefulSet",
"Job",
"CronJob",
"Ingress",
"APIService",
}
DefaultKindsOrder the default order
var NoCreateUpdateKindsOrder KindsOrder = []string{}