filter

package
v0.2.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionReplace = "replace"
	ActionRemove  = "remove"
	DefaultAction = ActionReplace
)

Variables

View Source
var Filters = map[string]func() kio.Filter{
	"FileSetter":      func() kio.Filter { return &kiofilters.FileSetter{} },
	"FormatFilter":    func() kio.Filter { return &kiofilters.FormatFilter{} },
	"GrepFilter":      func() kio.Filter { return &kiofilters.GrepFilter{} },
	"MatchModifier":   func() kio.Filter { return &kiofilters.MatchModifyFilter{} },
	"Modifier":        func() kio.Filter { return &kiofilters.Modifier{} },
	"LabelRemover":    func() kio.Filter { return &LabelRemover{} },
	"FieldNormalizer": func() kio.Filter { return &FieldNormalizer{} },
}

Functions

This section is empty.

Types

type FieldNormalizer

type FieldNormalizer struct {
	Kind       string        `yaml:"kind,omitempty"`
	Match      MatchCriteria `yaml:"match,omitempty"`
	FieldPaths []FieldPath   `yaml:"fieldPaths,omitempty"`
}

func (*FieldNormalizer) Filter

func (fn *FieldNormalizer) Filter(input []*yaml.RNode) ([]*yaml.RNode, error)

type FieldPath

type FieldPath struct {
	Path        []string `yaml:"path"`
	Action      string   `yaml:"action,omitempty"`
	Placeholder string   `yaml:"placeholder,omitempty"`
}

type FilterConfig

type FilterConfig struct {
	Kind    string    `yaml:"kind,omitempty"`
	Filters []KFilter `yaml:"filters,omitempty"`
}

FilterConfig defines a pipeline of KIO filters to apply.

type KFilter

type KFilter struct {
	kio.Filter
}

KFilter wraps a kio.Filter for YAML marshaling and unmarshaling.

func (KFilter) MarshalYAML

func (f KFilter) MarshalYAML() (any, error)

func (*KFilter) UnmarshalYAML

func (f *KFilter) UnmarshalYAML(unmarshal func(any) error) error

type LabelRemover

type LabelRemover struct {
	Kind   string     `yaml:"kind,omitempty"`
	Labels []string   `yaml:"labels"`
	Paths  [][]string `yaml:"paths"`
}

LabelRemover removes specified labels from resources at given field paths. If no paths are specified, it defaults to metadata/labels and spec/template/metadata/labels.

func (LabelRemover) Filter

func (lr LabelRemover) Filter(input []*yaml.RNode) ([]*yaml.RNode, error)

type MatchCriteria

type MatchCriteria struct {
	Group         string `yaml:"group,omitempty"`
	Version       string `yaml:"version,omitempty"`
	Kind          string `yaml:"kind,omitempty"`
	Name          string `yaml:"name,omitempty"`
	Namespace     string `yaml:"namespace,omitempty"`
	HasAnnotation string `yaml:"hasAnnotation,omitempty"`
}

Jump to

Keyboard shortcuts

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