kustomize

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

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

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

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

func AdditionalPatcher(op ...Patcher) Option

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

func WithResourcePath(path string) Option

WithResourcePath allows you to specify a kustomization folder other than default.

type OverlayFile

type OverlayFile struct {
	Name string
	Data []byte
}

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

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

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

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

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

Patch patches the given *types.Kustomization with information in resource.ParentResource.

Jump to

Keyboard shortcuts

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