filters

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterAll added in v0.3.3

func FilterAll(f yaml.Filter) kio.Filter

FilterAll is similar to `kio.FilterAll` except instead of evaluating for side effects, only the non-nil nodes returned by the filter are preserved.

func FilterOne

func FilterOne(f kio.Filter) yaml.Filter

FilterOne is the opposite of kio.FilterAll, useful if you have a filter that is optimized for filtering batches of nodes but you just need to call `Pipe` on a single node.

Types

type Pipeline added in v0.3.3

type Pipeline struct {
	Inputs                []kio.Reader
	Filters               []kio.Filter
	ContinueOnEmptyResult bool
}

Pipeline wraps a KYAML pipeline but doesn't allow writers: instead the resulting resource nodes are returned directly. This is useful for applying filters to readers in memory. A pipeline can also be used as a reader in larger pipelines.

func (*Pipeline) Read added in v0.3.3

func (p *Pipeline) Read() ([]*yaml.RNode, error)

Execute this pipeline, returning the resulting resource nodes directly.

type ReaderFunc added in v0.3.3

type ReaderFunc func() ([]*yaml.RNode, error)

ReaderFunc is an adapter to allow the use of ordinary functions as a kio.Reader.

func (ReaderFunc) Read added in v0.3.3

func (f ReaderFunc) Read() ([]*yaml.RNode, error)

Read evaluates the typed function.

type ResourceMetaFilter

type ResourceMetaFilter struct {
	// Regular expression matching the group.
	Group string `json:"group,omitempty" yaml:"group,omitempty"`
	// Regular expression matching the version.
	Version string `json:"version,omitempty" yaml:"version,omitempty"`
	// Regular expression matching the kind.
	Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`
	// Regular expression matching the namespace.
	Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
	// Regular expression matching the name.
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
	// Kubernetes selector matching labels.
	LabelSelector string `json:"labelSelector,omitempty" yaml:"labelSelector,omitempty"`
	// Kubernetes selector matching annotations
	AnnotationSelector string `json:"annotationSelector,omitempty" yaml:"annotationSelector,omitempty"`
}

ResourceMetaFilter filters nodes based on their resource metadata using regular expressions or Kubernetes selectors.

func (*ResourceMetaFilter) Filter

func (f *ResourceMetaFilter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error)

Jump to

Keyboard shortcuts

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