resource

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 6 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFinalizer

func AddFinalizer(o metav1.Object, finalizer string)

AddFinalizer to the supplied k8s object's metadata.

func FinalizerExists

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

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

func Ignore

func Ignore(is ErrorIs, err error) error

func IgnoreAny

func IgnoreAny(err error, is ...ErrorIs) error

IgnoreAny ignores errors that satisfy any of the supplied ErrorIs functions by returning nil. Errors that do not satisfy any of the supplied functions are returned unmodified.

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 RemoveFinalizer

func RemoveFinalizer(o metav1.Object, finalizer string)

RemoveFinalizer from the supplied k8s object's metadata.

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, reconcilerName string) *APIFinalizer

NewAPIFinalizer returns a new APIFinalizer.

func (*APIFinalizer) AddFinalizer

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

AddFinalizer to the supplied Managed resource.

func (*APIFinalizer) RemoveFinalizer

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

func (*APIFinalizer) Update added in v0.0.8

func (r *APIFinalizer) Update(ctx context.Context, obj client.Object, patch client.Patch) error

type ErrorIs

type ErrorIs func(err error) bool

type Finalizer

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

Finalizer manages the lifecycle of the finalizer on a k8s object

Jump to

Keyboard shortcuts

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