Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct { // ResourcePath is the folder that the base resources reside in the // filesystem. It should be given as absolute path. ResourcePath string // Kustomization is the content of kustomization.yaml file that contains // Kustomize config. Kustomization *kustomizeapi.Kustomization // Patchers contains the modifications that you'd like to make to // the overlay Kustomization object before calling kustomize. Patchers PatcherChain // OverlayGenerators contains the overlay generators that will be added // to the file system alongside kustomization.yaml OverlayGenerators OverlayGeneratorChain }
Engine is satisfies TemplatingEngine interface with an implementation that calls Kustomize for doing the resource generation.
func NewKustomizeEngine ¶
func NewKustomizeEngine(k *kustomizeapi.Kustomization, opt ...Option) *Engine
NewKustomizeEngine returns a Engine object. rootPath should point to the folder where your base kustomization.yaml resides and patcher is the chain of Patcher that makes modifications of Kustomization object.
func (*Engine) Run ¶
func (o *Engine) Run(cr resource.ParentResource) ([]resource.ChildResource, error)
Run is called to trigger kustomization operation and returns the generated raw Kubernetes objects.
type NamePrefixer ¶
type NamePrefixer struct{}
NamePrefixer adds the name of the ParentResource as name prefix to be used in Kustomize.
func NewNamePrefixer ¶
func NewNamePrefixer() NamePrefixer
NewNamePrefixer returns a new *NamePrefixer.
func (NamePrefixer) Patch ¶
func (np NamePrefixer) Patch(cr resource.ParentResource, k *types.Kustomization) error
Patch patches the *types.Kustomization object with information from resource.ParentResource
type Option ¶
type Option func(*Engine)
Option is used to manipulate default Engine parameters.
func AdditionalPatcher ¶ added in v0.3.0
AdditionalPatcher allows you to append Patcher objects to the patch pipeline.
func WithOverlayGenerator ¶ added in v0.3.0
func WithOverlayGenerator(op ...OverlayGenerator) Option
WithOverlayGenerator allows you to append OverlayGenerator objects to the generation pipeline.
func WithResourcePath ¶
WithResourcePath allows you to specify a kustomization folder other than default.
type OverlayFile ¶
OverlayFile is used to represent the files to be written to the top overlay folder used during kustomization operation.
type OverlayGenerator ¶
type OverlayGenerator interface {
Generate(resource.ParentResource, *types.Kustomization) ([]OverlayFile, error)
}
OverlayGenerator is used for generating files to be written to the top kustomization folder.
type OverlayGeneratorChain ¶
type OverlayGeneratorChain []OverlayGenerator
OverlayGeneratorChain makes it easier to provide a list of OverlayGenerator to be called in order.
func (OverlayGeneratorChain) Generate ¶
func (ogc OverlayGeneratorChain) Generate(cr resource.ParentResource, k *types.Kustomization) ([]OverlayFile, error)
Generate generates OverlayFiles.
type OverlayGeneratorFunc ¶ added in v0.3.0
type OverlayGeneratorFunc func(cr resource.ParentResource, k *types.Kustomization) ([]OverlayFile, error)
OverlayGeneratorFunc makes it easier to provide only a function as OverlayGenerator.
func (OverlayGeneratorFunc) Generate ¶ added in v0.3.0
func (kof OverlayGeneratorFunc) Generate(cr resource.ParentResource, k *types.Kustomization) ([]OverlayFile, error)
Generate generates OverlayFiles.
type PatchOverlayGenerator ¶
type PatchOverlayGenerator struct {
Overlays []v1alpha1.KustomizeEngineOverlay
}
PatchOverlayGenerator generates PatchStrategicMerge files with the given overlay settings.
func NewPatchOverlayGenerator ¶
func NewPatchOverlayGenerator(overlays []v1alpha1.KustomizeEngineOverlay) PatchOverlayGenerator
NewPatchOverlayGenerator returns a new PatchOverlayGenerator.
func (PatchOverlayGenerator) Generate ¶
func (pog PatchOverlayGenerator) Generate(cr resource.ParentResource, k *types.Kustomization) ([]OverlayFile, error)
Generate produces files to be written to the overlay folder of kustomization process.
type Patcher ¶
type Patcher interface {
Patch(resource.ParentResource, *types.Kustomization) error
}
A Patcher is used to make modifications on Kustomization overlay object before the render.
type PatcherChain ¶ added in v0.3.0
type PatcherChain []Patcher
PatcherChain makes it easier to provide a list of Patcher to be called in order.
func (PatcherChain) Patch ¶ added in v0.3.0
func (koc PatcherChain) Patch(cr resource.ParentResource, k *types.Kustomization) error
Patch patches the given *types.Kustomization with information in resource.ParentResource.
type PatcherFunc ¶
type PatcherFunc func(resource.ParentResource, *types.Kustomization) error
PatcherFunc makes it easier to provide only a function as Patcher
func (PatcherFunc) Patch ¶
func (kof PatcherFunc) Patch(cr resource.ParentResource, k *types.Kustomization) error
Patch patches the given *types.Kustomization with information in resource.ParentResource.