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
- type APIPatchingApplicator
- type Applicator
- type ApplyFn
- type ApplyOption
- type ClientApplicator
- type Conditioned
- type ErrorIs
- type Object
- type ProviderConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ignore ¶ added in v0.3.4
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 ¶ added in v0.3.4
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 ¶ added in v0.3.4
IgnoreNotFound returns the supplied error, or nil if the error indicates a Kubernetes resource was not found.
func IsAPIError ¶ added in v0.3.4
IsAPIError returns true if the given error's type is of Kubernetes API error.
func IsAPIErrorWrapped ¶ added in v0.3.4
IsAPIErrorWrapped returns true if err is a K8s API error, or recursively wraps a K8s API error
Types ¶
type APIFinalizer ¶ added in v0.3.15
type APIFinalizer struct {
// contains filtered or unexported fields
}
An APIFinalizer adds and removes finalizers to and from a resource.
func (*APIFinalizer) AddFinalizer ¶ added in v0.3.15
func (a *APIFinalizer) AddFinalizer(ctx context.Context, obj Object) error
AddFinalizer to the supplied Managed resource.
func (*APIFinalizer) RemoveFinalizer ¶ added in v0.3.15
func (a *APIFinalizer) RemoveFinalizer(ctx context.Context, obj Object) error
RemoveFinalizer from the supplied Managed resource.
type APIPatchingApplicator ¶ added in v0.3.2
type APIPatchingApplicator struct {
// contains filtered or unexported fields
}
An APIPatchingApplicator applies changes to an object by either creating or patching it in a Kubernetes API server.
func NewAPIPatchingApplicator ¶ added in v0.3.2
func NewAPIPatchingApplicator(c client.Client) *APIPatchingApplicator
NewAPIPatchingApplicator returns an Applicator that applies changes to an object by either creating or patching it in a Kubernetes API server.
func (*APIPatchingApplicator) Apply ¶ added in v0.3.3
func (a *APIPatchingApplicator) Apply(ctx context.Context, o client.Object, ao ...ApplyOption) error
Apply changes to the supplied object. The object will be created if it does not exist, or patched if it does. If the object does exist, it will only be patched if the passed object has the same or an empty resource version.
type Applicator ¶ added in v0.3.0
An Applicator applies changes to an object.
type ApplyOption ¶ added in v0.3.0
An ApplyOption is called before patching the current object to match the desired object. ApplyOptions are not called if no current object exists.
func MustBeControllableBy ¶ added in v0.3.9
func MustBeControllableBy(u types.UID) ApplyOption
MustBeControllableBy requires that the current object is controllable by an object with the supplied UID. An object is controllable if its controller reference matches the supplied UID, or it has no controller reference. An error that satisfies IsNotControllable will be returned if the current object cannot be controlled by the supplied UID.
func UpdateFn ¶ added in v0.3.0
func UpdateFn(fn func(current, desired runtime.Object)) ApplyOption
UpdateFn returns an ApplyOption that is used to modify the current object to match fields of the desired.
type ClientApplicator ¶ added in v0.3.0
type ClientApplicator struct { client.Client Applicator }
A ClientApplicator may be used to build a single 'client' that satisfies both client.Client and Applicator.
type Conditioned ¶
type Conditioned interface { SetConditions(c ...nddv1.Condition) GetCondition(nddv1.ConditionKind) nddv1.Condition }
A Conditioned may have conditions set or retrieved. Conditions are typically indicate the status of both a resource and its reconciliation process.
type ErrorIs ¶ added in v0.3.4
An ErrorIs function returns true if an error satisfies a particular condition.
type ProviderConfig ¶
type ProviderConfig interface { Object Conditioned }
A ProviderConfig configures a Network Device Driver provider.