fields

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	// Name is the value from metadata.name field selector, empty if not specified
	Name string
	// Namespace is the value from metadata.namespace field selector, empty if not specified
	Namespace string
}

Filter holds field selector filters extracted from a field selector string.

func ParseFieldSelector

func ParseFieldSelector(fieldSelector fields.Selector) (*Filter, error)

ParseFieldSelector parses a field selector and extracts metadata.name and metadata.namespace values. Other field selectors are silently ignored as controller-runtime cache doesn't support them. See: https://github.com/kubernetes-sigs/controller-runtime/issues/612

func (*Filter) MatchesName

func (f *Filter) MatchesName(name string) bool

MatchesName returns true if the filter has no name constraint or if the name matches.

func (*Filter) MatchesNamespace

func (f *Filter) MatchesNamespace(namespace string) bool

MatchesNamespace returns true if the filter has no namespace constraint or if the namespace matches.

Jump to

Keyboard shortcuts

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