predicate

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package predicate defines Predicates used by Controllers to filter Events before they are provided to EventHandlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FinalizerChangedPredicate

type FinalizerChangedPredicate struct {
	predicate.Funcs
}

FinalizerChangedPredicate implements a default update predicate function on finalizer change.

This predicate will skip update events that have no change in the object's finalizer. It is intended to be used in conjunction with the GenerationChangedPredicate, as in the following example:

Controller.Watch(

&source.Kind{Type: v1.MyCustomKind},
&handler.EnqueueRequestForObject{},
predicate.Or(predicate.GenerationChangedPredicate{}, predicate.FinalizerChangedPredicate{}))

This is mostly useful for controllers that needs to trigger both when the resource's generation is incremented (i.e., when the resource' .spec changes), or an finalizer changes.

func (FinalizerChangedPredicate) Update

Jump to

Keyboard shortcuts

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