Documentation

Overview

Copyright 2019 The Crossplane Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KustomizationPatcher

type KustomizationPatcher interface {
	Patch(resource.ParentResource, *types.Kustomization) error
}

A KustomizationPatcher is used to make modifications on Kustomization overlay object before the render.

type KustomizationPatcherChain

type KustomizationPatcherChain []KustomizationPatcher

KustomizationPatcherChain makes it easier to provide a list of KustomizationPatcher to be called in order.

func (KustomizationPatcherChain) Patch

type KustomizationPatcherFunc

type KustomizationPatcherFunc func(resource.ParentResource, *types.Kustomization) error

KustomizationPatcherFunc makes it easier to provide only a function as KustomizationPatcher

func (KustomizationPatcherFunc) Patch

type KustomizeEngine

type KustomizeEngine 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 KustomizationPatcherChain

	// OverlayGenerators contains the overlay generators that will be added
	// to the file system alongside kustomization.yaml
	OverlayGenerators OverlayGeneratorChain
}

func NewKustomizeEngine

func NewKustomizeEngine(k *kustomizeapi.Kustomization, opt ...KustomizeOption) *KustomizeEngine

NewKustomizeEngine returns a KustomizeEngine object. rootPath should point to the folder where your base kustomization.yaml resides and patcher is the chain of KustomizationPatcher that makes modifications of Kustomization object.

func (*KustomizeEngine) Run

type KustomizeOption

type KustomizeOption func(*KustomizeEngine)

KustomizeOption is used to manipulate default KustomizeEngine parameters.

func AdditionalKustomizationPatcher

func AdditionalKustomizationPatcher(op ...KustomizationPatcher) KustomizeOption

AdditionalKustomizationPatcher allows you to append KustomizationPatcher objects to the patch pipeline.

func AdditionalOverlayGenerator

func AdditionalOverlayGenerator(op ...OverlayGenerator) KustomizeOption

AdditionalOverlayGenerator allows you to append OverlayGenerator objects to the generation pipeline.

func WithResourcePath

func WithResourcePath(path string) KustomizeOption

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

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

type NamespaceNamePrefixer

type NamespaceNamePrefixer struct{}

NamePrefixer adds the name of the ParentResource as name prefix to be used in Kustomize.

func NewNamespaceNamePrefixer

func NewNamespaceNamePrefixer() NamespaceNamePrefixer

NewNamePrefixer returns a new *NamePrefixer.

func (NamespaceNamePrefixer) Patch

type OverlayFile

type OverlayFile struct {
	Name string
	Data []byte
}

type OverlayGenerator

type OverlayGenerator interface {
	Generate(resource.ParentResource, *types.Kustomization) ([]OverlayFile, error)
}

type OverlayGeneratorChain

type OverlayGeneratorChain []OverlayGenerator

OverlayGeneratorChain makes it easier to provide a list of OverlayGenerator to be called in order.

func (OverlayGeneratorChain) Generate

type PatchOverlayGenerator

type PatchOverlayGenerator struct {
	Overlays []v1alpha1.KustomizeEngineOverlay
}

NamePrefixer adds the name of the ParentResource as name prefix to be used in Kustomize.

func NewPatchOverlayGenerator

func NewPatchOverlayGenerator(overlays []v1alpha1.KustomizeEngineOverlay) PatchOverlayGenerator

NewPatchOverlayGenerator returns a new PatchOverlayGenerator.

func (PatchOverlayGenerator) Generate

type VariantFiller

type VariantFiller struct{}

VariantFiller fills the Variants that refer to the ParentResource with the correct name and namespace.

func NewVarReferenceFiller

func NewVarReferenceFiller() VariantFiller

NewNamePrefixer returns a new *NamePrefixer.

func (VariantFiller) Patch