Documentation ¶
Index ¶
- func Ignore(is ErrorIs, err error) error
- func IgnoreAny(err error, is ...ErrorIs) error
- func IgnoreNotFound(err error) error
- func IgnoreUpdateWithoutGenerationChangePredicate() predicate.Predicate
- func IsAPIError(err error) bool
- func IsAPIErrorWrapped(err error) bool
- func MustCreateObject(kind schema.GroupVersionKind, oc runtime.ObjectCreater) runtime.Object
- func NewPredicates(fn PredicateFn) predicate.Funcs
- 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 APIPatchingApplicator
- type APIUpdatingApplicator
- type Applicator
- type ApplyFn
- type ApplyOption
- type ClientApplicator
- type Conditioned
- type DeploymentPolicy
- type ErrorIs
- type Finalizer
- 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 HealthConditioned
- type Managed
- type ManagedKind
- type ManagedList
- type Object
- type PredicateFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ignore ¶ added in v0.0.10
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.0.10
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.0.10
IgnoreNotFound returns the supplied error, or nil if the error indicates a Kubernetes resource was not found.
func IgnoreUpdateWithoutGenerationChangePredicate ¶ added in v0.0.12
func IsAPIError ¶ added in v0.0.10
IsAPIError returns true if the given error's type is of Kubernetes API error.
func IsAPIErrorWrapped ¶ added in v0.0.10
IsAPIErrorWrapped returns true if err is a K8s API error, or recursively wraps a K8s API error
func MustCreateObject ¶ added in v0.0.8
func MustCreateObject(kind schema.GroupVersionKind, oc runtime.ObjectCreater) runtime.Object
MustCreateObject returns a new Object of the supplied kind. It panics if the kind is unknown to the supplied ObjectCreator.
func NewPredicates ¶ added in v0.0.12
func NewPredicates(fn PredicateFn) predicate.Funcs
NewPredicates returns a set of Funcs that are all satisfied by the supplied PredicateFn. The PredicateFn is run against the new object during updates.
Types ¶
type APIFinalizer ¶ added in v0.0.10
type APIFinalizer struct {
// contains filtered or unexported fields
}
An APIFinalizer adds and removes finalizers to and from a resource.
func NewAPIFinalizer ¶ added in v0.0.10
func NewAPIFinalizer(c client.Client, finalizer string) *APIFinalizer
NewAPIFinalizer returns a new APIFinalizer.
func (*APIFinalizer) AddFinalizer ¶ added in v0.0.10
func (a *APIFinalizer) AddFinalizer(ctx context.Context, obj Object) error
AddFinalizer to the supplied Managed resource.
func (*APIFinalizer) AddFinalizerString ¶ added in v0.0.10
func (a *APIFinalizer) AddFinalizerString(ctx context.Context, obj Object, finalizerString string) error
AddFinalizer to the supplied Managed resource.
func (*APIFinalizer) HasOtherFinalizer ¶ added in v0.0.10
func (*APIFinalizer) RemoveFinalizer ¶ added in v0.0.10
func (a *APIFinalizer) RemoveFinalizer(ctx context.Context, obj Object) error
RemoveFinalizer from the supplied Managed resource.
func (*APIFinalizer) RemoveFinalizerString ¶ added in v0.0.10
func (a *APIFinalizer) RemoveFinalizerString(ctx context.Context, obj Object, finalizerString string) error
RemoveFinalizer from the supplied Managed resource.
type APIPatchingApplicator ¶ added in v0.0.10
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.0.10
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.0.10
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 APIUpdatingApplicator ¶ added in v0.0.10
type APIUpdatingApplicator struct {
// contains filtered or unexported fields
}
An APIUpdatingApplicator applies changes to an object by either creating or updating it in a Kubernetes API server.
func NewAPIUpdatingApplicator ¶ added in v0.0.10
func NewAPIUpdatingApplicator(c client.Client) *APIUpdatingApplicator
NewAPIUpdatingApplicator returns an Applicator that applies changes to an object by either creating or updating it in a Kubernetes API server.
func (*APIUpdatingApplicator) Apply ¶ added in v0.0.10
func (a *APIUpdatingApplicator) 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 updated if it does.
type Applicator ¶ added in v0.0.10
An Applicator applies changes to an object.
type ApplyOption ¶ added in v0.0.10
An ApplyOption is called before patching the current object to match the desired object. ApplyOptions are not called if no current object exists.
func UpdateFn ¶ added in v0.0.10
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.0.10
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 ¶ added in v0.0.11
type DeploymentPolicy ¶ added in v0.0.71
type DeploymentPolicy interface { SetDeploymentPolicy(nddov1.DeploymentPolicy) GetDeploymentPolicy() nddov1.DeploymentPolicy }
type ErrorIs ¶ added in v0.0.10
An ErrorIs function returns true if an error satisfies a particular condition.
type Finalizer ¶
type Finalizer interface { AddFinalizer(ctx context.Context, obj Object) error RemoveFinalizer(ctx context.Context, obj Object) error HasOtherFinalizer(ctx context.Context, obj Object) (bool, error) AddFinalizerString(ctx context.Context, obj Object, finalizerString string) error RemoveFinalizerString(ctx context.Context, obj Object, finalizerString string) error }
A Finalizer manages the finalizers on the resource.
type FinalizerFns ¶ added in v0.0.10
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 ¶ added in v0.0.10
func (f FinalizerFns) AddFinalizer(ctx context.Context, obj Object) error
AddFinalizer to the supplied resource.
func (FinalizerFns) AddFinalizerString ¶ added in v0.0.10
func (f FinalizerFns) AddFinalizerString(ctx context.Context, obj Object, finalizerString string) error
AddFinalizer to the supplied resource.
func (FinalizerFns) HasOtherFinalizer ¶ added in v0.0.10
RemoveFinalizer from the supplied resource.
func (FinalizerFns) RemoveFinalizer ¶ added in v0.0.10
func (f FinalizerFns) RemoveFinalizer(ctx context.Context, obj Object) error
RemoveFinalizer from the supplied resource.
func (FinalizerFns) RemoveFinalizerString ¶ added in v0.0.10
func (f FinalizerFns) RemoveFinalizerString(ctx context.Context, obj Object, finalizerString string) error
RemoveFinalizer from the supplied resource.
type HealthConditioned ¶ added in v0.0.77
type HealthConditioned interface {
SetHealthConditions(c nddov1.HealthConditionedStatus)
}
type Managed ¶
type Managed interface { Object Conditioned HealthConditioned DeploymentPolicy }
A Managed is a Kubernetes object representing a concrete managed resource (e.g. a CloudSQL instance).
type ManagedKind ¶ added in v0.0.8
type ManagedKind schema.GroupVersionKind
A ManagedKind contains the type metadata for a kind of managed resource.
type ManagedList ¶
type ManagedList interface { client.ObjectList // GetItems returns the list of managed resources. GetItems() []Managed }
A ManagedList is a list of managed resources.
type PredicateFn ¶ added in v0.0.12
A PredicateFn returns true if the supplied object should be reconciled.