manifests

package
v0.3.142 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: Apache-2.0 Imports: 23 Imported by: 4

Documentation

Overview

Package manifests contains types and functionality around generating (rendering) the descriptors of the component's dependent resources. Most prominently, this is the Generator interface itself, and some tooling to enhance or transform existing generators.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeMapInto added in v0.3.41

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

Deep-merge second map (y) over first map (x) with the usual logic. The first map will be changed (unless y is empty or nil), the second map will not be changed. The first map must not be nil, the second map is allowed to be nil.

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. Both maps can be passed as nil.

Types

type Decryptor added in v0.3.125

type Decryptor interface {
	Decrypt(input []byte, path string) ([]byte, error)
}

Decryptor interface. Allows to decrypt content of referenced manifest sources.

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(ctx context.Context, namespace string, name string, parameters types.Unstructurable) ([]client.Object, error)

Generate resource descriptors.

type Generator

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

Resource generator interface. When called from the reconciler, the arguments namespace and name will match the component's namespace and name or, if the component or its spec implement the PlacementConfiguration interface, the return values of the GetDeploymentNamespace(), GetDeploymentName() methods (if non-empty). The parameters argument will be assigned the return value of the component's GetSpec() method.

type KustomizeImage added in v0.3.142

type KustomizeImage struct {
	Name    string `json:"name"`
	NewName string `json:"newName,omitempty"`
	NewTag  string `json:"newTag,omitempty"`
	Digest  string `json:"digest,omitempty"`
}

Kustomize image modifier specification, basically a subset of sigs.k8s.io/kustomize/api/types#Image

func (*KustomizeImage) DeepCopy added in v0.3.142

func (in *KustomizeImage) DeepCopy() *KustomizeImage

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KustomizeImage.

func (*KustomizeImage) DeepCopyInto added in v0.3.142

func (in *KustomizeImage) DeepCopyInto(out *KustomizeImage)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type KustomizeObjectTransformer added in v0.3.142

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

func NewKustomizeObjectTransformer added in v0.3.142

func NewKustomizeObjectTransformer(patches []KustomizePatch, images []KustomizeImage) (*KustomizeObjectTransformer, error)

func (*KustomizeObjectTransformer) TransformObjects added in v0.3.142

func (t *KustomizeObjectTransformer) TransformObjects(namespace string, name string, objects []client.Object) ([]client.Object, error)

type KustomizePatch added in v0.3.142

type KustomizePatch struct {
	Patch  string             `json:"patch,omitempty"`
	Target *KustomizeSelector `json:"target,omitempty"`
}

Kustomize patch specification, basically a subset of sigs.k8s.io/kustomize/api/types#Patch

func (*KustomizePatch) DeepCopy added in v0.3.142

func (in *KustomizePatch) DeepCopy() *KustomizePatch

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KustomizePatch.

func (*KustomizePatch) DeepCopyInto added in v0.3.142

func (in *KustomizePatch) DeepCopyInto(out *KustomizePatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type KustomizeSelector added in v0.3.142

type KustomizeSelector struct {
	Group              string `json:"group,omitempty"`
	Version            string `json:"version,omitempty"`
	Kind               string `json:"kind,omitempty"`
	Name               string `json:"name,omitempty"`
	Namespace          string `json:"namespace,omitempty"`
	AnnotationSelector string `json:"annotationSelector,omitempty"`
	LabelSelector      string `json:"labelSelector,omitempty"`
}

Kustomize object selector; corresponds to sigs.k8s.io/kustomize/api/types#Selector

func (*KustomizeSelector) DeepCopy added in v0.3.142

func (in *KustomizeSelector) DeepCopy() *KustomizeSelector

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KustomizeSelector.

func (*KustomizeSelector) DeepCopyInto added in v0.3.142

func (in *KustomizeSelector) DeepCopyInto(out *KustomizeSelector)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

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 SubstitutionObjectTransformer added in v0.3.142

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

func NewSubstitutionObjectTransformer added in v0.3.142

func NewSubstitutionObjectTransformer(substitutions map[string]string, selector types.Selector[client.Object]) (*SubstitutionObjectTransformer, error)

func (*SubstitutionObjectTransformer) TransformObjects added in v0.3.142

func (t *SubstitutionObjectTransformer) TransformObjects(namespace string, name string, objects []client.Object) ([]client.Object, error)

type TemplateParameterTransformer

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

TemplateParameterTransformer allows to transform parameters through a given go template. The template can use all functions from the sprig library, plus toYaml, fromYaml, toJson, fromJson, required.

func NewTemplateParameterTransformer

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

Create a new TemplateParameterTransformer (reading the template from the given fsys and path). If fsys is nil, the local OS filesystem will be used.

func (*TemplateParameterTransformer) TransformParameters

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

Transform parameters.

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

Wrap a given Generator into a TransformableGenerator, to allow to attach further parameter or object transformers to it.

Directories

Path Synopsis
Package manifests contains the HelmGenerator implementation of the Generator interface.
Package manifests contains the HelmGenerator implementation of the Generator interface.
Package manifests contains the KustomizeGenerator implementation of the Generator interface.
Package manifests contains the KustomizeGenerator implementation of the Generator interface.

Jump to

Keyboard shortcuts

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