Documentation ¶
Overview ¶
Package filter contains methods for filtering bundles.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filterer ¶
type Filterer struct {
// contains filtered or unexported fields
}
Filterer filters the components and objects to produce a new set of components.
func NewFilterer ¶ added in v0.5.0
func NewFilterer(comp []*bundle.ComponentPackage) *Filterer
func (*Filterer) FilterComponents ¶
func (f *Filterer) FilterComponents(o *Options) []*bundle.ComponentPackage
FilterComponents filters components based on the ObjectMeta properties of the components, returning a new cluster bundle with just filtered components. By default components are removed, unless KeepOnly is set, and then the opposite is true. Filtering for components doesn't take into account the properties of the object-children of the components.
func (*Filterer) FilterObjects ¶
func (f *Filterer) FilterObjects(o *Options) []*bundle.ComponentPackage
FilterObjects filters objects based on the ObjectMeta properties of the objects, returning a new cluster bundle with just filtered objects. By default objectsare removed, unless KeepOnly is set, and then the opposite is true.
type Options ¶
type Options struct { // Kinds represent the Kinds to filter on. Kinds []string // Names represent the metadata.names to filter on. Names []string // Annotations contain key/value pairs to filter on. An empty string value matches // all annotation-values for a particular key. Annotations map[string]string // Labels contain key/value pairs to filter on. An empty string value matches // all label-values for a particular key. Labels map[string]string // Namespaces to filter on. Namespaces []string // KeepOnly means that instead of removing the found objects. KeepOnly bool }
Options for filtering bundles. By default, if any of the options match, then the relevant component or object is removed. If KeepOnly is set, then the objects are kept instead of removed.