predicates

package
v1.10.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package predicates provides predicates for filtering events.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBackupStoragePredicate added in v1.8.0

func GetBackupStoragePredicate() predicate.Funcs

GetBackupStoragePredicate returns a predicate that filters events for BackupStorage resources.

func GetLoadBalancerConfigPredicate added in v1.9.0

func GetLoadBalancerConfigPredicate() predicate.Funcs

GetLoadBalancerConfigPredicate returns a predicate that filters events for LoadBalancerConfig resources.

func GetMonitoringConfigPredicate added in v1.8.0

func GetMonitoringConfigPredicate() predicate.Funcs

GetMonitoringConfigPredicate returns a predicate that filters events for MonitoringConfig resources.

func GetPodSchedulingPolicyPredicate added in v1.7.0

func GetPodSchedulingPolicyPredicate() predicate.Funcs

GetPodSchedulingPolicyPredicate returns a predicate that filters events for PodSchedulingPolicy resources.

Types

type NamespaceFilter

type NamespaceFilter struct {
	// AllowNamespaces is a list of namespaces to allow.
	AllowNamespaces []string
	// MatchLabels is a map of labels to match on the namespace.
	// All labels specified here need to match the labels on the namespace (i.e, they're ANDed).
	MatchLabels map[string]string
	// GetNamespace gets the namespace by name.
	GetNamespace func(ctx context.Context, name string) (*corev1.Namespace, error)
	// Log is the logger.
	Log logr.Logger
}

NamespaceFilter is a predicate that filters events based on the specified namespace configuration.

func (*NamespaceFilter) Create

func (p *NamespaceFilter) Create(event event.CreateEvent) bool

Create returns true if the object should be created.

func (*NamespaceFilter) Delete

func (p *NamespaceFilter) Delete(event event.DeleteEvent) bool

Delete returns true if the object should be deleted.

func (*NamespaceFilter) Generic

func (p *NamespaceFilter) Generic(event event.GenericEvent) bool

Generic returns true if the object should be processed.

func (*NamespaceFilter) Match

func (p *NamespaceFilter) Match(namespace *corev1.Namespace) bool

Match returns true if the filter allows the namespace.

func (*NamespaceFilter) Update

func (p *NamespaceFilter) Update(event event.UpdateEvent) bool

Update returns true if the object should be updated.

type Nop

type Nop struct{}

Nop is a predicate that allows all events.

func (Nop) Create

func (p Nop) Create(_ event.CreateEvent) bool

func (Nop) Delete

func (p Nop) Delete(_ event.DeleteEvent) bool

func (Nop) Generic

func (p Nop) Generic(_ event.GenericEvent) bool

func (Nop) Update

func (p Nop) Update(_ event.UpdateEvent) bool

Directories

Path Synopsis
Package enginefeatures contains a set of predicates for the enginefeatures.everest.percona.com API group that can be used by controllers.
Package enginefeatures contains a set of predicates for the enginefeatures.everest.percona.com API group that can be used by controllers.

Jump to

Keyboard shortcuts

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