predicates

package
v0.0.0-...-fc29aca Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: UPL-1.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 NamedPredicate

type NamedPredicate struct {
	Name      string
	Namespace string
}

NamedPredicate is an event handler that watches for a resource identified by a specific namespace and name.

func (NamedPredicate) Create

func (w NamedPredicate) Create(e event.CreateEvent) bool

func (NamedPredicate) Delete

func (w NamedPredicate) Delete(e event.DeleteEvent) bool

func (NamedPredicate) Generic

func (w NamedPredicate) Generic(e event.GenericEvent) bool

func (NamedPredicate) Update

func (w NamedPredicate) Update(e event.UpdateEvent) bool

type SecondaryPredicate

type SecondaryPredicate struct {
	predicate.Funcs
}

SecondaryPredicate is a predicate that filters events for resources created as dependents of a primary resource. It follows the following rules:

  • Create events are ignored because it is assumed that the controller reconciling the parent is the client creating the dependent resources.
  • Update events are always handled.
  • Deletion events are always handled because a controller will typically want to recreate deleted dependent resources if the primary resource is not deleted.
  • Generic events are ignored.

SecondaryPredicate is most often used in conjunction with controller-runtime handler.EnqueueRequestForOwner

func (SecondaryPredicate) Create

Create filters out all events. It assumes that the controller reconciling the parent is the only client creating the dependent resources.

func (SecondaryPredicate) Delete

Delete passes all events through. This allows the controller to recreate deleted dependent resources if the primary resource is not deleted.

func (SecondaryPredicate) Generic

Generic filters out all events.

func (SecondaryPredicate) Update

Update passes all events through.

Jump to

Keyboard shortcuts

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