predicate

package
v1.12.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtractorFunc

type ExtractorFunc func(obj runtime.Object) Func

An ExtractorFunc applies a transformation to a runtime.Object and creates a predicate function based on the result of the transformation. This can be used to apply complex lookup logic to determine which resources should be enqueued if another resource being watched changes, for example, enqueuing all Certificate resources that own a CertificateRequest that has been observed, or enqueuing all Certificate resources that specify `status.nextPrivateKeySecretName` as the name of the Secret being processed.

func ExtractResourceName

func ExtractResourceName(p func(s string) Func) ExtractorFunc

ExtractResourceName is a helper function used to extract a name from a metav1.Object being enqueued to construct a Func that is variadic based on a string value.

type Func

type Func func(obj runtime.Object) bool

Func is a generic function used to filter various types of resources.

func CertificateNextPrivateKeySecretName

func CertificateNextPrivateKeySecretName(name string) Func

CertificateSecretName returns a predicate that used to filter Certificates to only those with the given 'status.nextPrivateKeySecretName'. It is not possible to select Certificates with a 'nil' secret name using this predicate function.

func CertificateRequestRevision

func CertificateRequestRevision(revision int) Func

CertificateRequestRevision returns a predicate that used to filter CertificateRequest to only those with a given 'revision' number.

func CertificateSecretName

func CertificateSecretName(name string) Func

CertificateSecretName returns a predicate that used to filter Certificates to only those with the given 'spec.secretName'.

func ResourceOwnedBy

func ResourceOwnedBy(owner runtime.Object) Func

ResourceOwnedBy will filter returned results to only those with the given resource as an owner.

func ResourceOwnerOf

func ResourceOwnerOf(obj runtime.Object) Func

ResourceOwnerOf will filter returned results to only those that own the given resource.

type Funcs

type Funcs []Func

Funcs is a list of predicates to be AND'd together.

func (Funcs) Evaluate

func (f Funcs) Evaluate(obj runtime.Object) bool

Evaluate will evaluate all the predicate functions in order, AND'ing together the results.

Jump to

Keyboard shortcuts

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