meta

package
v0.0.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAnnotations

func AddAnnotations(o metav1.Object, annotations map[string]string)

func AddFinalizer

func AddFinalizer(o metav1.Object, finalizer string)

AddFinalizer to the supplied k8s object's metadata.

func AddLabels

func AddLabels(o metav1.Object, labels map[string]string)

func FinalizerExists

func FinalizerExists(o metav1.Object, finalizer string) bool

FinalizerExists checks whether a certain finalizer is already set on the aupplied object

func GVKToString

func GVKToString(gvk *schema.GroupVersionKind) string

func GetUnstructuredFromGVK

func GetUnstructuredFromGVK(gvk *schema.GroupVersionKind) *unstructured.Unstructured

func Ignore

func Ignore(is ErrorIs, err error) error

func IgnoreNotFound

func IgnoreNotFound(err error) error

IgnoreNotFound returns the supplied error, or nil if the error indicates a Kubernetes resource was not found.

func MarshalData

func MarshalData(o *unstructured.Unstructured) (any, error)

func RemoveAnnotations

func RemoveAnnotations(o metav1.Object, annotations ...string)

func RemoveFinalizer

func RemoveFinalizer(o metav1.Object, finalizer string)

RemoveFinalizer from the supplied k8s object's metadata.

func RemoveLabels

func RemoveLabels(o metav1.Object, labels ...string)

func StringToGVK

func StringToGVK(s string) *schema.GroupVersionKind

func WasDeleted

func WasDeleted(o metav1.Object) bool

Types

type APIFinalizer

type APIFinalizer struct {
	// contains filtered or unexported fields
}

An APIFinalizer manages the lifecycle of a finalizer on a k8s object.

func NewAPIFinalizer

func NewAPIFinalizer(c client.Client, finalizer string) *APIFinalizer

NewAPIFinalizer returns a new APIFinalizer.

func (*APIFinalizer) AddFinalizer

func (a *APIFinalizer) AddFinalizer(ctx context.Context, obj Object) error

AddFinalizer to the supplied Managed resource.

func (*APIFinalizer) RemoveFinalizer

func (a *APIFinalizer) RemoveFinalizer(ctx context.Context, obj Object) error

type ErrorIs

type ErrorIs func(err error) bool

type Finalizer

type Finalizer interface {
	AddFinalizer(ctx context.Context, obj Object) error
	RemoveFinalizer(ctx context.Context, obj Object) error
}

Finalizer manages the lifecycle of the finalizer on a k8s object

type Object

type Object interface {
	metav1.Object
	runtime.Object
}

Jump to

Keyboard shortcuts

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