Documentation
¶
Index ¶
- func GetConfigMapValue(ctx context.Context, kube client.Client, ref *commonv1.ConfigMapKeySelector) (string, error)
- func GetSecret(ctx context.Context, k client.Client, ref *commonv1.SecretKeySelector) (string, error)
- 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
- func IsMissingReference(err error) bool
- func MustCreateObject(kind schema.GroupVersionKind, oc runtime.ObjectCreater) runtime.Object
- type APIFinalizer
- type AttributeReferencer
- type CanReference
- type Conditioned
- type Conditions
- type ErrorIs
- type Finalizer
- type FinalizerFns
- type Managed
- type ManagedKind
- type ManagedList
- type Object
- type ReferenceStatus
- type ReferenceStatusType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfigMapValue ¶
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
func IsMissingReference ¶
IsMissingReference returns true if an error indicates that a managed resource is missing a required reference..
func MustCreateObject ¶
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.
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) RemoveFinalizer ¶
func (a *APIFinalizer) RemoveFinalizer(ctx context.Context, obj Object) error
RemoveFinalizer from the supplied Managed resource.
type AttributeReferencer ¶
type AttributeReferencer interface {
// GetStatus retries the referenced resource, as well as other non-managed
// resources (like a `Provider`) and reports their readiness for use as a
// referenced resource.
GetStatus(ctx context.Context, res CanReference, r client.Reader) ([]ReferenceStatus, error)
// Build retrieves the referenced resource, as well as other non-managed
// resources (like a `Provider`), and builds the referenced attribute,
// returning it as a string value.
Build(ctx context.Context, res CanReference, r client.Reader) (value string, err error)
// Assign accepts a managed resource object, and assigns the given value to
// its corresponding property.
Assign(res CanReference, value string) error
}
An AttributeReferencer resolves cross-resource attribute references. See https://github.com/crossplane/crossplane/blob/master/design/one-pager-cross-resource-referencing.md for more information
type CanReference ¶
A CanReference is a resource that can reference another resource in its spec in order to automatically resolve corresponding spec field values by inspecting the referenced resource.
type Conditioned ¶
type Conditioned interface {
SetConditions(c ...prv1.Condition)
GetCondition(prv1.ConditionType) prv1.Condition
}
A Conditioned may have conditions set or retrieved. Conditions are typically indicate the status of both a resource and its reconciliation process.
type Conditions ¶
func (Conditions) DeepCopy ¶
func (cs Conditions) DeepCopy() Conditions
func (*Conditions) JoinConditions ¶
func (cs *Conditions) JoinConditions(conds *Conditions)
func (*Conditions) RemoveCondition ¶
func (cs *Conditions) RemoveCondition(ct rtv1.ConditionType)
func (*Conditions) UpsertCondition ¶
func (cs *Conditions) UpsertCondition(cond rtv1.Condition)
func (*Conditions) UpsertConditionMessage ¶
func (cs *Conditions) UpsertConditionMessage(cond rtv1.Condition)
type Finalizer ¶
type Finalizer interface {
AddFinalizer(ctx context.Context, obj Object) error
RemoveFinalizer(ctx context.Context, obj Object) error
}
A Finalizer manages the finalizers on the resource.
func NewNopFinalizer ¶
func NewNopFinalizer() Finalizer
NewNopFinalizer returns a Finalizer that does nothing.
type FinalizerFns ¶
type FinalizerFns struct {
AddFinalizerFn func(ctx context.Context, obj Object) error
RemoveFinalizerFn func(ctx context.Context, obj Object) 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) RemoveFinalizer ¶
func (f FinalizerFns) RemoveFinalizer(ctx context.Context, obj Object) error
RemoveFinalizer from the supplied resource.
type Managed ¶
type Managed interface {
Object
Conditioned
}
A Managed is a Kubernetes object representing a concrete managed resource (e.g. a CloudSQL instance).
type ManagedKind ¶
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 ReferenceStatus ¶
type ReferenceStatus struct {
Name string
Status ReferenceStatusType
}
ReferenceStatus has the name and status of a reference
func (ReferenceStatus) String ¶
func (r ReferenceStatus) String() string
type ReferenceStatusType ¶
type ReferenceStatusType int
ReferenceStatusType is an enum type for the possible values for a Reference Status
const ( ReferenceStatusUnknown ReferenceStatusType = iota ReferenceNotFound ReferenceNotReady ReferenceReady )
Reference statuses.
func (ReferenceStatusType) String ¶
func (t ReferenceStatusType) String() string