meta

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsFinalizer

func ContainsFinalizer(finalizers []string, finalizer string) bool

ContainsFinalizer returns true if the given finalizer is in the list.

func FilterFinalizers

func FilterFinalizers(finalizers []string, filter func(f string) bool) []string

FilterFinalizers filters a list of finalizers with some filter function.

func IsDeleting

func IsDeleting(object metav1.Object) bool

IsDeleting returns true if the object is pending deletion.

func IsFinalFinalizer

func IsFinalFinalizer(prefix string, finalizers []string, finalizer string) bool

IsFinalFinalizer returns whether the list of finalizers does not contain other finalizers with the given prefix. Pass a prefix to filter finalizers, to prevent blocking on other finalizers, e.g. foregroundDeletion.

func IsPendingFinalizer

func IsPendingFinalizer(object metav1.Object, finalizer string) bool

IsPendingFinalizer returns true if the object is pending deletion and contains the given finalizer. Use this to determine when to remove the finalizer.

func MergeFinalizers

func MergeFinalizers(finalizers1, finalizers2 []string) []string

MergeFinalizers merges the list of finalizers, removing duplicates if any.

func RemoveFinalizer

func RemoveFinalizer(finalizers []string, finalizer string) []string

RemoveFinalizer removes the given finalizer from the list of finalizers.

func SetAnnotation

func SetAnnotation(object Annotatable, key, value string)

SetAnnotation updates the object's annotations, setting the annotation given by key to be value. The Annotations map is updated in-place, if needed please DeepCopy before calling this function.

func SetLabel added in v0.2.0

func SetLabel(object Labelable, key, value string)

SetLabel updates the object's labels, setting the label given by key to be value. The Labels map is updated in-place, if needed please DeepCopy before calling this function.

Types

type Annotatable added in v0.2.0

type Annotatable interface {
	GetAnnotations() map[string]string
	SetAnnotations(annotations map[string]string)
}

type Labelable added in v0.2.0

type Labelable interface {
	GetLabels() map[string]string
	SetLabels(annotations map[string]string)
}

Jump to

Keyboard shortcuts

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