Back to godoc.org

Package predicate

v0.16.1
Latest Go to latest

The latest major version is .

Published: Aug 7, 2020 | License: Apache-2.0 | Module: github.com/jetstack/cert-manager

Index

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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier