predicate

package
v1.41.3 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvalGeneric

func EvalGeneric(obj client.Object, predicates ...predicate.Predicate) bool

EvalGeneric returns true if all predicates match for the given object.

func FromMapper

func FromMapper(mapper Mapper, triggers ...MapperTrigger) predicate.Predicate

FromMapper creates a new predicate from the given Mapper that reacts on the given MapperTriggers.

func IsDeleting

func IsDeleting() predicate.Predicate

IsDeleting is a predicate for objects having a deletion timestamp.

func Not

Not inverts the passed predicate.

func Or added in v1.39.0

func Or(predicates ...predicate.Predicate) predicate.Predicate

Or returns a composite predicate that implements a logical OR of the predicates passed to it. TODO: This is a copy of "sigs.k8s.io/controller-runtime/pkg/predicate.Or" with the addition of the InjectFunc.

Delete this code once the upstream library supports the InjectFunc as well.

func ShootIsUnassigned

func ShootIsUnassigned() predicate.Predicate

ShootIsUnassigned is a predicate that returns true if a shoot is not assigned to a seed.

Types

type Mapper

type Mapper interface {
	Map(event event.GenericEvent) bool
}

Mapper maps any event (in form of a GenericEvent) to a boolean whether the event shall be propagated or not.

type MapperFunc

type MapperFunc func(event.GenericEvent) bool

MapperFunc is a function that implements Mapper.

func (MapperFunc) Map

func (f MapperFunc) Map(event event.GenericEvent) bool

Map implements Mapper.

type MapperTrigger

type MapperTrigger uint8

MapperTrigger is a trigger a Mapper can react upon.

const (
	// CreateTrigger is a MapperTrigger for create events.
	CreateTrigger MapperTrigger = iota
	// UpdateOldTrigger is a MapperTrigger for update events with the old meta and object.
	UpdateOldTrigger
	// UpdateNewTrigger is a MapperTrigger for update events with the new meta and object.
	UpdateNewTrigger
	// DeleteTrigger is a MapperTrigger for delete events.
	DeleteTrigger
	// GenericTrigger is a MapperTrigger for generic events.
	GenericTrigger
)

Jump to

Keyboard shortcuts

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