ctrlutils

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const KongIngressFinalizer = "configuration.konghq.com/ingress"

KongIngressFinalizer is the finalizer used to ensure Kong configuration cleanup for deleted resources.

Variables

This section is empty.

Functions

func CleanupFinalizer

func CleanupFinalizer(ctx context.Context, c client.Client, log logr.Logger, nsn types.NamespacedName, obj client.Object) (ctrl.Result, error)

CleanupFinalizer ensures that a deleted resource is no longer present in the object cache.

func GeneratePredicateFuncsForIngressClassFilter

func GeneratePredicateFuncsForIngressClassFilter(name string, specCheckEnabled, annotationCheckEnabled bool) predicate.Funcs

GeneratePredicateFuncsForIngressClassFilter builds a controller-runtime reconcilation predicate function which filters out objects which do not have the "kubernetes.io/ingress.class" annotation configured and set to the provided value or in their .spec.

func HasAnnotation

func HasAnnotation(obj client.Object, key, expectedValue string) bool

HasAnnotation is a helper function to determine whether an object has a given annotation, and whether it's to the value provided.

func HasFinalizer

func HasFinalizer(obj client.Object, finalizer string) bool

HasFinalizer is a helper function to check whether a client.Object already has a specific finalizer set.

func IsIngressClassAnnotationConfigured

func IsIngressClassAnnotationConfigured(obj client.Object, expectedIngressClassName string) bool

IsIngressClassAnnotationConfigured determines whether an object has an ingress.class annotation configured that matches the provide IngressClassName (and is therefore an object configured to be reconciled by that class).

NOTE: keep in mind that the ingress.class annotation is deprecated and will be removed in a future release

of Kubernetes in favor of the .spec based implementation.

func IsIngressClassSpecConfigured

func IsIngressClassSpecConfigured(obj client.Object, expectedIngressClassName string) bool

IsIngressClassAnnotationConfigured determines whether an object has IngressClassName field in its spec and whether the value matches the provide IngressClassName (and is therefore an object configured to be reconciled by that class).

func MatchesIngressClassName

func MatchesIngressClassName(obj client.Object, ingressClassName string) bool

MatchesIngressClassName indicates whether or not an object indicates that it's supported by the ingress class name provided.

Types

This section is empty.

Jump to

Keyboard shortcuts

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