transform

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Transform

func Transform(fs filesys.FileSystem, manifestTransform ManifestTransform, commonTransforms ...TransformFunc) error

Transform takes a Filesystem, a ManifestTransform and a set of common transforms to be applied on all the manifests, and transforms all the manifests.

Types

type ManifestTransform

type ManifestTransform map[string][]TransformFunc

ManifestTransform is a map of manifest file path and the transformation that needs to be run on the manifest.

type OwnerRefTemplateParam

type OwnerRefTemplateParam struct {
	APIVersion         string
	Kind               string
	Name               string
	UID                types.UID
	Controller         bool
	BlockOwnerDeletion bool
}

OwnerRefTemplateParam stores the data for the OwnerReference template.

func GetOwnerRefTemplateParamFor

func GetOwnerRefTemplateParamFor(ownerRef metav1.OwnerReference) OwnerRefTemplateParam

GetOwnerRefTemplateParamFor returns a OwnerRefTemplateParam for a given OwnerReference.

type TransformFunc

type TransformFunc func(*yaml.RNode) error

TransformFunc is the type of a transform function. A transformation must return a TransformFunc.

func AddAnnotationsFunc

func AddAnnotationsFunc(annotations map[string]string) TransformFunc

AddAnnotationsFunc returns a TransformFunc that adds the given annotations to an object.

func AddLabelsFunc

func AddLabelsFunc(labels map[string]string) TransformFunc

AddLabelsFunc returns a TransformFunc that adds the given labels to an object.

func SetOwnerReference

func SetOwnerReference(ownerRefs []metav1.OwnerReference) TransformFunc

SetOwnerReference returns a TransformFunc that sets the ownerReferences in a given object.

func SetReplicaFunc

func SetReplicaFunc(replica int) TransformFunc

SetReplicaFunc returns a TransformFunc that sets the replicas (spec.replicas) in a given object.

Jump to

Keyboard shortcuts

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