pkg

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceGroup   = "fn.kpt.dev"
	ResourceVersion = "v1alpha1"
)

Variables

This section is empty.

Functions

func WriteAnnotation

func WriteAnnotation(obj *yaml.RNode, atm mutation.ApplyTimeMutation) error

WriteAnnotation updates the supplied RNode object to add the apply-time-mutation annotation with a multi-line yaml value.

Types

type ApplyTimeMutation

type ApplyTimeMutation struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              ApplyTimeMutationSpec `json:"spec,omitempty"`
}

ApplyTimeMutation is a Kubernetes resource that allows specifying mutations using a seperate KRM object, instead of an annotation string on the target object.

type ApplyTimeMutationSpec

type ApplyTimeMutationSpec struct {
	TargetRef     mutation.ResourceReference `json:"targetRef,omitempty"`
	Substitutions mutation.ApplyTimeMutation `json:"substitutions,omitempty"`
}

ApplyTimeMutationSpec specifies a one or more substitutions to perform on a target object at apply-time.

type CommentScanner

type CommentScanner struct {
	// ObjMeta is a reference to the object using metadata
	ObjMeta yaml.ResourceIdentifier
	// ObjFile is a reference to the object using file and object index
	ObjFile framework.File
}

func (*CommentScanner) Scan

func (cs *CommentScanner) Scan(obj *yaml.RNode) ([]ScanResult, error)

Scan searches for mutation markup comments and parses them as substitutions.

type Function

type Function struct{}

func (*Function) Process

func (rp *Function) Process(resourceList *framework.ResourceList) error

type ObjectScanner

type ObjectScanner struct{}

func (*ObjectScanner) Scan

func (os *ObjectScanner) Scan(obj *yaml.RNode) (*ApplyTimeMutation, error)

Scan searches for mutation markup comments and parses them as substitutions.

type PathBuilder

type PathBuilder struct {
	Fields []interface{}
}

func (*PathBuilder) Pop

func (pb *PathBuilder) Pop() interface{}

Pop removes and returns the last field in the path. Returns nil if empty.

func (*PathBuilder) Push

func (pb *PathBuilder) Push(field interface{})

Push appends a field to the path.

func (*PathBuilder) String

func (pb *PathBuilder) String() string

String returns a JSONPath expression to the specified field. This conforms to the path syntax used by the apply-time-mutation annotation.

type ScanResult

type ScanResult struct {
	Path         string
	Value        interface{}
	Comment      string
	Substitution mutation.FieldSubstitution
}

Jump to

Keyboard shortcuts

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