filter

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LabelRunID is an annotation key to mark an object with
	// the unique ID of a test run.
	LabelRunID = "integration-tester/run-id"

	// LabelVersion is an annotation key to mark an object
	// with the version of the test harness that created it.
	LabelVersion = "integration-tester/version"

	// LabelManagedBy is a label key to mark an object as
	// managed by the test harness.
	LabelManagedBy = "app.kubernetes.io/managed-by"
)

Variables

This section is empty.

Functions

func ObjectRunID

func ObjectRunID(u *unstructured.Unstructured) string

ObjectRunID returns the value of the LabelRunID annotation on the given object.

Types

type MetaInjectionFilter

type MetaInjectionFilter struct {
	RunID     string
	ManagedBy string
}

MetaInjectionFilter injects ObjectMeta data into Kubernetes objects. Specifically, it labels objects with the ManagedBy string, and annotates with the RunID.

func (*MetaInjectionFilter) Filter

func (m *MetaInjectionFilter) Filter(rn *yaml.RNode) (*yaml.RNode, error)

Filter ...

type Rename

type Rename struct {
	// Name is the new name of the object.
	Name string
	// Namespace is the new namespace of the object.
	Namespace string
}

Rename is a filter that rewrites the name of a Kubernetes object, i.e. it replaces the value of the `metadata.name` field.

func (Rename) Filter

func (r Rename) Filter(rn *yaml.RNode) (*yaml.RNode, error)

Filter applies the rename and returns rn.

type SpecialOpsFilter

type SpecialOpsFilter struct {
	Ops map[string]interface{}

	Decoders map[string]yaml.Unmarshaler
}

SpecialOpsFilter is a yaml.Filter that extracts top-level YAML keys whose name begins with `$`. These keys denote special operations that test drivers need to interpolate.

func (*SpecialOpsFilter) Filter

func (s *SpecialOpsFilter) Filter(rn *yaml.RNode) (*yaml.RNode, error)

Filter runs the SpecialOpsFilter.

type UnmarshalFunc

type UnmarshalFunc func(value *yaml.Node) error

UnmarshalFunc is a yaml.Unmarshaler adapator.

func (UnmarshalFunc) UnmarshalYAML

func (u UnmarshalFunc) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML ...

Jump to

Keyboard shortcuts

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