Documentation ¶
Index ¶
- func Ignore(is ErrorIs, err error) error
- func IgnoreAny(err error, is ...ErrorIs) error
- func IgnoreNotFound(err error) error
- func IsAPIError(err error) bool
- func IsAPIErrorWrapped(err error) bool
- type APIFinalizer
- func (a *APIFinalizer) AddFinalizer(ctx context.Context, obj Object) error
- func (a *APIFinalizer) AddFinalizerString(ctx context.Context, obj Object, finalizerString string) error
- func (a *APIFinalizer) HasOtherFinalizer(ctx context.Context, obj Object) (bool, error)
- func (a *APIFinalizer) RemoveFinalizer(ctx context.Context, obj Object) error
- func (a *APIFinalizer) RemoveFinalizerString(ctx context.Context, obj Object, finalizerString string) error
- type ErrorIs
- type FinalizerFns
- func (f FinalizerFns) AddFinalizer(ctx context.Context, obj Object) error
- func (f FinalizerFns) AddFinalizerString(ctx context.Context, obj Object, finalizerString string) error
- func (f FinalizerFns) HasOtherFinalizer(ctx context.Context, obj Object) (bool, error)
- func (f FinalizerFns) RemoveFinalizer(ctx context.Context, obj Object) error
- func (f FinalizerFns) RemoveFinalizerString(ctx context.Context, obj Object, finalizerString string) error
- type Object
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ignore ¶
Ignore any errors that satisfy the supplied ErrorIs function by returning nil. Errors that do not satisfy the supplied function are returned unmodified.
func IgnoreAny ¶
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 ¶
IgnoreNotFound returns the supplied error, or nil if the error indicates a Kubernetes resource was not found.
func IsAPIError ¶
IsAPIError returns true if the given error's type is of Kubernetes API error.
func IsAPIErrorWrapped ¶
IsAPIErrorWrapped returns true if err is a K8s API error, or recursively wraps a K8s API error
Types ¶
type APIFinalizer ¶
type APIFinalizer struct {
// contains filtered or unexported fields
}
An APIFinalizer adds and removes finalizers to and from a resource.
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) AddFinalizerString ¶
func (a *APIFinalizer) AddFinalizerString(ctx context.Context, obj Object, finalizerString string) error
AddFinalizer to the supplied Managed resource.
func (*APIFinalizer) HasOtherFinalizer ¶
func (*APIFinalizer) RemoveFinalizer ¶
func (a *APIFinalizer) RemoveFinalizer(ctx context.Context, obj Object) error
RemoveFinalizer from the supplied Managed resource.
func (*APIFinalizer) RemoveFinalizerString ¶
func (a *APIFinalizer) RemoveFinalizerString(ctx context.Context, obj Object, finalizerString string) error
RemoveFinalizer from the supplied Managed resource.
type FinalizerFns ¶
type FinalizerFns struct { AddFinalizerFn func(ctx context.Context, obj Object) error RemoveFinalizerFn func(ctx context.Context, obj Object) error HasOtherFinalizerFn func(ctx context.Context, obj Object) (bool, error) AddFinalizerStringFn func(ctx context.Context, obj Object, finalizerString string) error RemoveFinalizerStringFn func(ctx context.Context, obj Object, finalizerString string) error }
A FinalizerFns satisfy the Finalizer interface.
func (FinalizerFns) AddFinalizer ¶
func (f FinalizerFns) AddFinalizer(ctx context.Context, obj Object) error
AddFinalizer to the supplied resource.
func (FinalizerFns) AddFinalizerString ¶
func (f FinalizerFns) AddFinalizerString(ctx context.Context, obj Object, finalizerString string) error
AddFinalizer to the supplied resource.
func (FinalizerFns) HasOtherFinalizer ¶
RemoveFinalizer from the supplied resource.
func (FinalizerFns) RemoveFinalizer ¶
func (f FinalizerFns) RemoveFinalizer(ctx context.Context, obj Object) error
RemoveFinalizer from the supplied resource.
func (FinalizerFns) RemoveFinalizerString ¶
func (f FinalizerFns) RemoveFinalizerString(ctx context.Context, obj Object, finalizerString string) error
RemoveFinalizer from the supplied resource.