manifests

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: Apache-2.0 Imports: 26 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeMaps

func MergeMaps(x, y map[string]any) map[string]any

Deep-merge two maps with the usual logic and return the result. The first map (x) must be deeply JSON (i.e. consist deeply of JSON values only). The maps given as input will not be changed.

Types

type DummyGenerator

type DummyGenerator struct{}

DummyGenerator is a generator that does nothing.

func NewDummyGenerator

func NewDummyGenerator() (*DummyGenerator, error)

Create a new DummyGenerator.

func (*DummyGenerator) Generate

func (g *DummyGenerator) Generate(namespace string, name string, parameters types.Unstructurable) ([]client.Object, error)

Generate resource descriptors.

type Generator

type Generator interface {
	Generate(namespace string, name string, parameters types.Unstructurable) ([]client.Object, error)
}

Resource generator interface. When called from the reconciler, namespace and name will match the respective values in the reconciled Component's spec, and parameters will be a pointer to the whole Component spec. Therefore, implementations which are directly called from the reconciler, can safely cast parameters back to their concrete spec struct.

type HelmGenerator

type HelmGenerator struct {
	// contains filtered or unexported fields
}

HelmGenerator is a Generator implementation that basically renders a given Helm chart. A few restrictions apply to the provided Helm chart: it must not contain any subcharts, some template functions are not supported, some bultin variables are not supported, and hooks are processed in a slightly different fashion.

func NewHelmGenerator

func NewHelmGenerator(name string, fsys fs.FS, chartPath string, client client.Client, discoveryClient discovery.DiscoveryInterface) (*HelmGenerator, error)

Create a new HelmGenerator.

func (*HelmGenerator) Generate

func (g *HelmGenerator) Generate(namespace string, name string, parameters types.Unstructurable) ([]client.Object, error)

Generate resource descriptors.

type KustomizeGenerator

type KustomizeGenerator struct {
	// contains filtered or unexported fields
}

KustomizeGenerator is a Generator implementation that basically renders a given Kustomization.

func NewKustomizeGenerator

func NewKustomizeGenerator(fsys fs.FS, kustomizationPath string, templateSuffix string, client client.Client) (*KustomizeGenerator, error)

Create a new KustomizeGenerator.

func (*KustomizeGenerator) Generate

func (g *KustomizeGenerator) Generate(namespace string, name string, parameters types.Unstructurable) ([]client.Object, error)

Generate resource descriptors.

type ObjectTransformer

type ObjectTransformer interface {
	TransformObjects(namespace string, name string, objects []client.Object) ([]client.Object, error)
}

Object transformer interface. Allows to manipulate the parameters returned by an existing generator.

type ParameterTransformer

type ParameterTransformer interface {
	TransformParameters(namespace string, name string, parameters types.Unstructurable) (types.Unstructurable, error)
}

Parameter transformer interface. Allows to manipulate the parameters passed to an existing generator.

type TemplateParameterTransformer

type TemplateParameterTransformer struct {
	// contains filtered or unexported fields
}

func NewTemplateParameterTransformer

func NewTemplateParameterTransformer(fsys fs.FS, path string) (*TemplateParameterTransformer, error)

func (*TemplateParameterTransformer) TransformParameters

func (t *TemplateParameterTransformer) TransformParameters(namespace string, name string, parameters types.Unstructurable) (types.Unstructurable, error)

type TransformableGenerator

type TransformableGenerator interface {
	Generator
	WithParameterTransformer(transformer ParameterTransformer) TransformableGenerator
	WithObjectTransformer(transformer ObjectTransformer) TransformableGenerator
}

Interface for generators that can be enhanced with parameter/object transformers.

func NewGenerator

func NewGenerator(generator Generator) TransformableGenerator

func NewHelmGeneratorWithObjectTransformer

func NewHelmGeneratorWithObjectTransformer(name string, fsys fs.FS, chartPath string, client client.Client, discoveryClient discovery.DiscoveryInterface, transformer ObjectTransformer) (TransformableGenerator, error)

Create a new HelmGenerator with an ObjectTransformer attached (further transformers can be attached to the reeturned generator object).

func NewHelmGeneratorWithParameterTransformer

func NewHelmGeneratorWithParameterTransformer(name string, fsys fs.FS, chartPath string, client client.Client, discoveryClient discovery.DiscoveryInterface, transformer ParameterTransformer) (TransformableGenerator, error)

Create a new HelmGenerator with a ParameterTransformer attached (further transformers can be attached to the reeturned generator object).

func NewKustomizeGeneratorWithObjectTransformer

func NewKustomizeGeneratorWithObjectTransformer(fsys fs.FS, kustomizationPath string, templateSuffix string, client client.Client, transformer ObjectTransformer) (TransformableGenerator, error)

Create a new KustomizeGenerator with an ObjectTransformer attached (further transformers can be attached to the reeturned generator object).

func NewKustomizeGeneratorWithParameterTransformer

func NewKustomizeGeneratorWithParameterTransformer(fsys fs.FS, kustomizationPath string, templateSuffix string, client client.Client, transformer ParameterTransformer) (TransformableGenerator, error)

Create a new KustomizeGenerator with a ParameterTransformer attached (further transformers can be attached to the reeturned generator object).

func NewTransformableHelmGenerator added in v0.1.2

func NewTransformableHelmGenerator(name string, fsys fs.FS, chartPath string, client client.Client, discoveryClient discovery.DiscoveryInterface) (TransformableGenerator, error)

Create a new HelmGenerator as TransformableGenerator

func NewTransformableKustomizeGenerator added in v0.1.2

func NewTransformableKustomizeGenerator(fsys fs.FS, kustomizationPath string, templateSuffix string, client client.Client) (TransformableGenerator, error)

Create a new KustomizeGenerator as TransformableGenerator

Jump to

Keyboard shortcuts

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