Documentation
¶
Overview ¶
Package resource provides types and functions that can be used to build Kubernetes controllers that reconcile Crossplane resources.
Index ¶
- Constants
- func AsProtobufStruct(o runtime.Object) (*structpb.Struct, error)
- func CommonCredentialExtractor(ctx context.Context, source xpv1.CredentialsSource, client client.Client, ...) ([]byte, error)
- func ConnectionSecretFor(o ConnectionSecretOwner, kind schema.GroupVersionKind) *corev1.Secret
- func DesiredStateChanged() predicate.Predicate
- func ExtractEnv(_ context.Context, e EnvLookupFn, s xpv1.CommonCredentialSelectors) ([]byte, error)
- func ExtractFs(_ context.Context, fs afero.Fs, s xpv1.CommonCredentialSelectors) ([]byte, error)
- func ExtractSecret(ctx context.Context, client client.Client, s xpv1.CommonCredentialSelectors) ([]byte, error)
- func FirstNAndSomeMore(n int, names []string) string
- func GetExternalTags(mg Managed) map[string]string
- func GetKind(obj runtime.Object, ot runtime.ObjectTyper) (schema.GroupVersionKind, 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 IsConditionTrue(c xpv1.Condition) bool
- func IsMissingReference(err error) bool
- func IsNotAllowed(err error) bool
- func IsNotControllable(err error) bool
- func LocalConnectionSecretFor(o LocalConnectionSecretOwner, kind schema.GroupVersionKind) *corev1.Secret
- func MustCreateObject(kind schema.GroupVersionKind, oc runtime.ObjectCreater) runtime.Object
- func MustGetKind(obj runtime.Object, ot runtime.ObjectTyper) schema.GroupVersionKind
- func NewNotAllowed(message string) error
- func NewPredicates(fn PredicateFn) predicate.Funcs
- func StableNAndSomeMore(n int, names []string) string
- type APIFinalizer
- type APIPatchingApplicator
- type APIUpdatingApplicator
- type AnnotationChangedPredicate
- type Applicator
- type ApplicatorWithRetry
- type ApplyFn
- type ApplyOption
- func AllowUpdateIf(fn func(current, desired runtime.Object) bool) ApplyOption
- func ConnectionSecretMustBeControllableBy(u types.UID) ApplyOption
- func MustBeControllableBy(u types.UID) ApplyOption
- func StoreCurrentRV(origRV *string) ApplyOption
- func UpdateFn(fn func(current, desired runtime.Object)) ApplyOption
- type AttributeReferencer
- type CanReference
- type Claim
- type ClaimReferencer
- type ClientApplicator
- type Composed
- type ComposedResourcesReferencer
- type Composite
- type CompositeClaim
- type CompositeClaimKind
- type CompositeKind
- type CompositeResourceDeleter
- type CompositeResourceReferencer
- type CompositionReferencer
- type CompositionRevisionReferencer
- type CompositionRevisionSelector
- type CompositionSelector
- type CompositionUpdater
- type Conditioned
- type ConnectionDetailsPublishedTimer
- type ConnectionSecretOwner
- type ConnectionSecretWriterTo
- type EnqueueRequestForProviderConfig
- func (e *EnqueueRequestForProviderConfig) Create(_ context.Context, evt event.CreateEvent, q RateLimitingInterface)
- func (e *EnqueueRequestForProviderConfig) Delete(_ context.Context, evt event.DeleteEvent, q RateLimitingInterface)
- func (e *EnqueueRequestForProviderConfig) Generic(_ context.Context, evt event.GenericEvent, q RateLimitingInterface)
- func (e *EnqueueRequestForProviderConfig) Update(_ context.Context, evt event.UpdateEvent, q RateLimitingInterface)
- type EnvLookupFn
- type EnvironmentConfigReferencer
- type ErrorIs
- type Finalizer
- type FinalizerFns
- type LateInitializer
- func (li *LateInitializer) IsChanged() bool
- func (li *LateInitializer) LateInitializeBoolPtr(org *bool, from *bool) *bool
- func (li *LateInitializer) LateInitializeInt64Ptr(org *int64, from *int64) *int64
- func (li *LateInitializer) LateInitializeStringPtr(org *string, from *string) *string
- func (li *LateInitializer) LateInitializeTimePtr(org *metav1.Time, from *time.Time) *metav1.Time
- func (li *LateInitializer) SetChanged()
- type LegacyComposite
- type LegacyManaged
- type LegacyManagedList
- type LegacyProviderConfigUsage
- type LegacyProviderConfigUsageTracker
- type LocalConnectionSecretOwner
- type LocalConnectionSecretWriterTo
- type Manageable
- type Managed
- type ManagedKind
- type ManagedList
- type ManagedResourceReferencer
- type ModernManaged
- type Object
- type Orphanable
- type PredicateFn
- type ProviderConfig
- type ProviderConfigKinds
- type ProviderConfigReferencer
- type ProviderConfigUsage
- type ProviderConfigUsageList
- type ProviderConfigUsageTracker
- type RateLimitingInterface
- type ReconciliationObserver
- type ReferenceStatus
- type ReferenceStatusType
- type RequiredProviderConfigReferencer
- type RequiredTypedProviderConfigReferencer
- type RequiredTypedResourceReferencer
- type Tracker
- type TrackerFn
- type TypedProviderConfigReferencer
- type TypedProviderConfigUsage
- type UserCounter
Constants ¶
const ( ExternalResourceTagKeyKind = "crossplane-kind" ExternalResourceTagKeyName = "crossplane-name" ExternalResourceTagKeyNamespace = "crossplane-namespace" ExternalResourceTagKeyProvider = "crossplane-providerconfig" ExternalResourceTagKeyProviderConfigKind = "crossplane-providerconfig-kind" )
External resources are tagged/labelled with the following keys in the cloud provider API if the type supports.
const DefaultFirstN = 3
DefaultFirstN is the default number of names to return in FirstNAndSomeMore.
const SecretTypeConnection corev1.SecretType = "connection.crossplane.io/v1alpha1"
SecretTypeConnection is the type of Crossplane connection secrets.
Variables ¶
This section is empty.
Functions ¶
func AsProtobufStruct ¶
AsProtobufStruct converts the given object to a structpb.Struct for usage with gRPC connections. Copied from: https://github.com/crossplane/crossplane/blob/release-1.16/internal/controller/apiextensions/composite/composition_functions.go#L761
func CommonCredentialExtractor ¶
func CommonCredentialExtractor(ctx context.Context, source xpv1.CredentialsSource, client client.Client, selector xpv1.CommonCredentialSelectors) ([]byte, error)
CommonCredentialExtractor extracts credentials from common sources.
func ConnectionSecretFor ¶
func ConnectionSecretFor(o ConnectionSecretOwner, kind schema.GroupVersionKind) *corev1.Secret
ConnectionSecretFor creates a connection for the supplied ConnectionSecretOwner, assumed to be of the supplied kind. The secret is written to 'default' namespace if the ConnectionSecretOwner does not specify a namespace.
func DesiredStateChanged ¶
DesiredStateChanged accepts objects that have changed their desired state, i.e. the state that is not managed by the controller. To be more specific, it accepts update events that have changes in one of the followings: - `metadata.annotations` (except for certain annotations) - `metadata.labels` - `spec`.
func ExtractEnv ¶
func ExtractEnv(_ context.Context, e EnvLookupFn, s xpv1.CommonCredentialSelectors) ([]byte, error)
ExtractEnv extracts credentials from an environment variable.
func ExtractSecret ¶
func ExtractSecret(ctx context.Context, client client.Client, s xpv1.CommonCredentialSelectors) ([]byte, error)
ExtractSecret extracts credentials from a Kubernetes secret.
func FirstNAndSomeMore ¶
FirstNAndSomeMore returns a string that contains the first n names in the supplied slice, followed by ", and <count> more" if there are more than n. The slice is not sorted, i.e. the caller must make sure the order is stable e.g. when using this in conditions.
func GetExternalTags ¶
GetExternalTags returns the identifying tags to be used to tag the external resource in provider API.
func GetKind ¶
func GetKind(obj runtime.Object, ot runtime.ObjectTyper) (schema.GroupVersionKind, error)
GetKind returns the GroupVersionKind of the supplied object. It return an error if the object is unknown to the supplied ObjectTyper, the object is unversioned, or the object does not have exactly one registered kind.
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 IsConditionTrue ¶
IsConditionTrue returns if condition status is true.
func IsMissingReference ¶
IsMissingReference returns true if an error indicates that a managed resource is missing a required reference..
func IsNotAllowed ¶
IsNotAllowed returns true if the supplied error indicates that an operation was not allowed.
func IsNotControllable ¶
IsNotControllable returns true if the supplied error indicates that a resource is not controllable - i.e. that it another resource is not and may not become its controller reference.
func LocalConnectionSecretFor ¶
func LocalConnectionSecretFor(o LocalConnectionSecretOwner, kind schema.GroupVersionKind) *corev1.Secret
LocalConnectionSecretFor creates a connection secret in the namespace of the supplied LocalConnectionSecretOwner, assumed to be of the supplied kind.
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.
func MustGetKind ¶
func MustGetKind(obj runtime.Object, ot runtime.ObjectTyper) schema.GroupVersionKind
MustGetKind returns the GroupVersionKind of the supplied object. It panics if the object is unknown to the supplied ObjectTyper, the object is unversioned, or the object does not have exactly one registered kind.
func NewNotAllowed ¶
NewNotAllowed returns a new NotAllowed error.
func NewPredicates ¶
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. Deprecated: This function will be removed soon. Please use controller-runtime's predicate.NewPredicateFuncs instead.
func StableNAndSomeMore ¶
StableNAndSomeMore is like FirstNAndSomeMore, but sorts the names before. The input slice is not modified.
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 APIPatchingApplicator ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 AnnotationChangedPredicate ¶
type AnnotationChangedPredicate struct {
predicate.Funcs
// contains filtered or unexported fields
}
AnnotationChangedPredicate implements a default update predicate function on annotation change by ignoring the given annotation keys, if any.
This predicate extends controller-runtime's AnnotationChangedPredicate by being able to ignore certain annotations.
func (AnnotationChangedPredicate) Update ¶
func (a AnnotationChangedPredicate) Update(e event.UpdateEvent) bool
Update implements default UpdateEvent filter for validating annotation change.
type Applicator ¶
An Applicator applies changes to an object.
type ApplicatorWithRetry ¶
type ApplicatorWithRetry struct {
Applicator
// contains filtered or unexported fields
}
An ApplicatorWithRetry applies changes to an object, retrying on transient failures.
func NewApplicatorWithRetry ¶
func NewApplicatorWithRetry(applicator Applicator, shouldRetry shouldRetryFunc, backoff *wait.Backoff) *ApplicatorWithRetry
NewApplicatorWithRetry returns an ApplicatorWithRetry for the specified applicator and with the specified retry function.
If backoff is nil, then retry.DefaultRetry is used as the default.
func (*ApplicatorWithRetry) Apply ¶
func (awr *ApplicatorWithRetry) Apply(ctx context.Context, c client.Object, opts ...ApplyOption) error
Apply invokes nested Applicator's Apply retrying on designated errors.
type ApplyOption ¶
An ApplyOption is called before patching the current object to match the desired object. ApplyOptions are not called if no current object exists.
func AllowUpdateIf ¶
func AllowUpdateIf(fn func(current, desired runtime.Object) bool) ApplyOption
AllowUpdateIf will only update the current object if the supplied fn returns true. An error that satisfies IsNotAllowed will be returned if the supplied function returns false. Creation of a desired object that does not currently exist is always allowed.
func ConnectionSecretMustBeControllableBy ¶
func ConnectionSecretMustBeControllableBy(u types.UID) ApplyOption
ConnectionSecretMustBeControllableBy requires that the current object is a connection secret that is controllable by an object with the supplied UID. Contemporary connection secrets are of SecretTypeConnection, while legacy connection secrets are of corev1.SecretTypeOpaque. Contemporary connection secrets are considered controllable if they are already controlled by the supplied UID, or have no controller reference. Legacy connection secrets are only considered controllable if they are already controlled by the supplied UID. It is not safe to assume legacy connection secrets without a controller reference are controllable because they are indistinguishable from Kubernetes secrets that have nothing to do with Crossplane. An error that satisfies IsNotControllable will be returned if the current secret is not a connection secret or cannot be controlled by the supplied UID.
func MustBeControllableBy ¶
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 StoreCurrentRV ¶
func StoreCurrentRV(origRV *string) ApplyOption
StoreCurrentRV stores the resource version of the current object in the supplied string pointer. This is useful to detect whether the Apply call was a no-op.
func UpdateFn ¶
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 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/main/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 ClaimReferencer ¶
type ClaimReferencer interface {
SetClaimReference(r *reference.Claim)
GetClaimReference() *reference.Claim
}
A ClaimReferencer may reference a resource claim.
type ClientApplicator ¶
type ClientApplicator struct {
client.Client
Applicator
}
A ClientApplicator may be used to build a single 'client' that satisfies both client.Client and Applicator.
type Composed ¶
type Composed interface {
Object
Conditioned
ConnectionSecretWriterTo
ReconciliationObserver
}
Composed resources can be a composed into a Composite resource.
type ComposedResourcesReferencer ¶
type ComposedResourcesReferencer interface {
SetResourceReferences(refs []corev1.ObjectReference)
GetResourceReferences() []corev1.ObjectReference
}
A ComposedResourcesReferencer may reference the resources it composes.
type Composite ¶
type Composite interface {
Object
CompositionSelector
CompositionReferencer
CompositionUpdater
CompositionRevisionReferencer
CompositionRevisionSelector
ComposedResourcesReferencer
Conditioned
ReconciliationObserver
}
A Composite resource (or XR) is composed of other resources.
type CompositeClaim ¶
type CompositeClaim interface {
Object
CompositionSelector
CompositionReferencer
CompositionUpdater
CompositionRevisionReferencer
CompositionRevisionSelector
CompositeResourceDeleter
CompositeResourceReferencer
LocalConnectionSecretWriterTo
Conditioned
ConnectionDetailsPublishedTimer
ReconciliationObserver
}
A CompositeClaim of a composite resource (XR).
type CompositeClaimKind ¶
type CompositeClaimKind schema.GroupVersionKind
A CompositeClaimKind contains the type metadata for a kind of composite resource claim.
type CompositeKind ¶
type CompositeKind schema.GroupVersionKind
A CompositeKind contains the type metadata for a kind of composite resource.
type CompositeResourceDeleter ¶
type CompositeResourceDeleter interface {
SetCompositeDeletePolicy(policy *xpv1.CompositeDeletePolicy)
GetCompositeDeletePolicy() *xpv1.CompositeDeletePolicy
}
A CompositeResourceDeleter creates a composite, and controls the policy used to delete the composite.
type CompositeResourceReferencer ¶
type CompositeResourceReferencer interface {
SetResourceReference(r *reference.Composite)
GetResourceReference() *reference.Composite
}
A CompositeResourceReferencer can reference a composite resource.
type CompositionReferencer ¶
type CompositionReferencer interface {
SetCompositionReference(ref *corev1.ObjectReference)
GetCompositionReference() *corev1.ObjectReference
}
A CompositionReferencer may reference a composition of resources.
type CompositionRevisionReferencer ¶
type CompositionRevisionReferencer interface {
SetCompositionRevisionReference(ref *corev1.LocalObjectReference)
GetCompositionRevisionReference() *corev1.LocalObjectReference
}
A CompositionRevisionReferencer may reference a specific revision of a composition of resources.
type CompositionRevisionSelector ¶
type CompositionRevisionSelector interface {
SetCompositionRevisionSelector(selector *metav1.LabelSelector)
GetCompositionRevisionSelector() *metav1.LabelSelector
}
A CompositionRevisionSelector may reference a set of composition revisions.
type CompositionSelector ¶
type CompositionSelector interface {
SetCompositionSelector(s *metav1.LabelSelector)
GetCompositionSelector() *metav1.LabelSelector
}
A CompositionSelector may select a composition of resources.
type CompositionUpdater ¶
type CompositionUpdater interface {
SetCompositionUpdatePolicy(p *xpv1.UpdatePolicy)
GetCompositionUpdatePolicy() *xpv1.UpdatePolicy
}
A CompositionUpdater uses a composition, and may update which revision of that composition it uses.
type Conditioned ¶
type Conditioned interface {
SetConditions(c ...xpv1.Condition)
GetCondition(ct xpv1.ConditionType) xpv1.Condition
}
A Conditioned may have conditions set or retrieved. Conditions are typically indicate the status of both a resource and its reconciliation process.
type ConnectionDetailsPublishedTimer ¶
type ConnectionDetailsPublishedTimer interface {
SetConnectionDetailsLastPublishedTime(t *metav1.Time)
GetConnectionDetailsLastPublishedTime() *metav1.Time
}
A ConnectionDetailsPublishedTimer can record the last time its connection details were published.
type ConnectionSecretOwner ¶
type ConnectionSecretOwner interface {
Object
ConnectionSecretWriterTo
}
A ConnectionSecretOwner is a Kubernetes object that owns a connection secret.
type ConnectionSecretWriterTo ¶
type ConnectionSecretWriterTo interface {
SetWriteConnectionSecretToReference(r *xpv1.SecretReference)
GetWriteConnectionSecretToReference() *xpv1.SecretReference
}
A ConnectionSecretWriterTo may write a connection secret to an arbitrary namespace.
type EnqueueRequestForProviderConfig ¶
type EnqueueRequestForProviderConfig struct{}
EnqueueRequestForProviderConfig enqueues a reconcile.Request for a referenced ProviderConfig.
func (*EnqueueRequestForProviderConfig) Create ¶
func (e *EnqueueRequestForProviderConfig) Create(_ context.Context, evt event.CreateEvent, q RateLimitingInterface)
Create adds a NamespacedName for the supplied CreateEvent if its Object is a ProviderConfigReferencer.
func (*EnqueueRequestForProviderConfig) Delete ¶
func (e *EnqueueRequestForProviderConfig) Delete(_ context.Context, evt event.DeleteEvent, q RateLimitingInterface)
Delete adds a NamespacedName for the supplied DeleteEvent if its Object is a ProviderConfigReferencer.
func (*EnqueueRequestForProviderConfig) Generic ¶
func (e *EnqueueRequestForProviderConfig) Generic(_ context.Context, evt event.GenericEvent, q RateLimitingInterface)
Generic adds a NamespacedName for the supplied GenericEvent if its Object is a ProviderConfigReferencer.
func (*EnqueueRequestForProviderConfig) Update ¶
func (e *EnqueueRequestForProviderConfig) Update(_ context.Context, evt event.UpdateEvent, q RateLimitingInterface)
Update adds a NamespacedName for the supplied UpdateEvent if its Objects are a ProviderConfigReferencer.
type EnvLookupFn ¶
EnvLookupFn looks up an environment variable.
type EnvironmentConfigReferencer ¶
type EnvironmentConfigReferencer interface {
SetEnvironmentConfigReferences(refs []corev1.ObjectReference)
GetEnvironmentConfigReferences() []corev1.ObjectReference
}
An EnvironmentConfigReferencer references a list of EnvironmentConfigs.
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 LateInitializer ¶
type LateInitializer struct {
// contains filtered or unexported fields
}
LateInitializer contains functions to late initialize two fields with varying types. The main purpose of LateInitializer is to be able to report whether anything different from the original value has been returned after all late initialization calls.
func NewLateInitializer ¶
func NewLateInitializer() *LateInitializer
NewLateInitializer returns a new instance of *LateInitializer.
func (*LateInitializer) IsChanged ¶
func (li *LateInitializer) IsChanged() bool
IsChanged reports whether the second argument is ever used in late initialization function calls.
func (*LateInitializer) LateInitializeBoolPtr ¶
func (li *LateInitializer) LateInitializeBoolPtr(org *bool, from *bool) *bool
LateInitializeBoolPtr implements late initialization for *bool.
func (*LateInitializer) LateInitializeInt64Ptr ¶
func (li *LateInitializer) LateInitializeInt64Ptr(org *int64, from *int64) *int64
LateInitializeInt64Ptr implements late initialization for *int64.
func (*LateInitializer) LateInitializeStringPtr ¶
func (li *LateInitializer) LateInitializeStringPtr(org *string, from *string) *string
LateInitializeStringPtr implements late initialization for *string.
func (*LateInitializer) LateInitializeTimePtr ¶
LateInitializeTimePtr implements late initialization for *metav1.Time from *time.Time.
func (*LateInitializer) SetChanged ¶
func (li *LateInitializer) SetChanged()
SetChanged marks the LateInitializer such that users can tell whether any of the late initialization calls returned the non-original argument.
type LegacyComposite ¶
type LegacyComposite interface {
Composite
ClaimReferencer
ConnectionSecretWriterTo
ConnectionDetailsPublishedTimer
}
A LegacyComposite is a Crossplane v1 style legacy XR.
type LegacyManaged ¶
type LegacyManaged interface {
Managed
ConnectionSecretWriterTo
ProviderConfigReferencer
Orphanable
}
A LegacyManaged is a cluster-scoped Kubernetes object representing a concrete managed resource, with namespaced connection secret referencers and untyped provider config reference. Deprecated: new namespace-scoped MRs should implement ModernManaged.
type LegacyManagedList ¶
type LegacyManagedList interface {
client.ObjectList
// GetItems returns the list of managed resources.
GetItems() []LegacyManaged
}
A LegacyManagedList is a list of managed resources. Deprecated: new types should implement ManagedList.
type LegacyProviderConfigUsage ¶
type LegacyProviderConfigUsage interface {
ProviderConfigUsage
RequiredProviderConfigReferencer
}
A LegacyProviderConfigUsage is a ProviderConfigUsage that has an untyped reference to a provider config. Deprecated: new PCUs should implement TypedProviderConfigUsage.
type LegacyProviderConfigUsageTracker ¶
type LegacyProviderConfigUsageTracker struct {
// contains filtered or unexported fields
}
A LegacyProviderConfigUsageTracker tracks usages of a by creating or updating the appropriate LegacyProviderConfigUsage.
func NewLegacyProviderConfigUsageTracker ¶
func NewLegacyProviderConfigUsageTracker(c client.Client, of LegacyProviderConfigUsage) *LegacyProviderConfigUsageTracker
NewLegacyProviderConfigUsageTracker tracks usages of a by creating or updating the appropriate LegacyProviderConfigUsage.
func (*LegacyProviderConfigUsageTracker) Track ¶
func (u *LegacyProviderConfigUsageTracker) Track(ctx context.Context, mg LegacyManaged) error
Track that the supplied LegacyManaged resource is using the ProviderConfig it references by creating or updating a ProviderConfigUsage. Track should be called _before_ attempting to use the ProviderConfig. This ensures the managed resource's usage is updated if the managed resource is updated to reference a misconfigured ProviderConfig.
type LocalConnectionSecretOwner ¶
type LocalConnectionSecretOwner interface {
runtime.Object
metav1.Object
LocalConnectionSecretWriterTo
}
A LocalConnectionSecretOwner may create and manage a connection secret in its own namespace.
type LocalConnectionSecretWriterTo ¶
type LocalConnectionSecretWriterTo interface {
SetWriteConnectionSecretToReference(r *xpv1.LocalSecretReference)
GetWriteConnectionSecretToReference() *xpv1.LocalSecretReference
}
A LocalConnectionSecretWriterTo may write a connection secret to its own namespace.
type Manageable ¶
type Manageable interface {
SetManagementPolicies(p xpv1.ManagementPolicies)
GetManagementPolicies() xpv1.ManagementPolicies
}
A Manageable resource may specify a ManagementPolicies.
type Managed ¶
type Managed interface {
Object
Manageable
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 ManagedResourceReferencer ¶
type ManagedResourceReferencer interface {
SetResourceReference(r *corev1.ObjectReference)
GetResourceReference() *corev1.ObjectReference
}
A ManagedResourceReferencer may reference a concrete managed resource.
type ModernManaged ¶
type ModernManaged interface {
Managed
LocalConnectionSecretWriterTo
TypedProviderConfigReferencer
}
A ModernManaged is a Kubernetes object representing a concrete managed resource with local connection secret references and typed provider config reference.
type Orphanable ¶
type Orphanable interface {
SetDeletionPolicy(p xpv1.DeletionPolicy)
GetDeletionPolicy() xpv1.DeletionPolicy
}
An Orphanable resource may specify a DeletionPolicy.
type PredicateFn ¶
A PredicateFn returns true if the supplied object should be reconciled. Deprecated: This type will be removed soon. Please use controller-runtime's predicate.NewPredicateFuncs instead.
type ProviderConfig ¶
type ProviderConfig interface {
Object
UserCounter
Conditioned
}
A ProviderConfig configures a Crossplane provider.
type ProviderConfigKinds ¶
type ProviderConfigKinds struct {
Config schema.GroupVersionKind
Usage schema.GroupVersionKind
UsageList schema.GroupVersionKind
}
ProviderConfigKinds contains the type metadata for a kind of provider config.
type ProviderConfigReferencer ¶
type ProviderConfigReferencer interface {
GetProviderConfigReference() *xpv1.Reference
SetProviderConfigReference(p *xpv1.Reference)
}
A ProviderConfigReferencer may reference a provider config resource.
type ProviderConfigUsage ¶
type ProviderConfigUsage interface {
Object
RequiredTypedResourceReferencer
}
A ProviderConfigUsage indicates a usage of a Crossplane provider config.
type ProviderConfigUsageList ¶
type ProviderConfigUsageList interface {
client.ObjectList
// GetItems returns the list of provider config usages.
GetItems() []ProviderConfigUsage
}
A ProviderConfigUsageList is a list of provider config usages.
type ProviderConfigUsageTracker ¶
type ProviderConfigUsageTracker struct {
// contains filtered or unexported fields
}
A ProviderConfigUsageTracker tracks usages of a ProviderConfig by creating or updating the appropriate ProviderConfigUsage.
func NewProviderConfigUsageTracker ¶
func NewProviderConfigUsageTracker(c client.Client, of TypedProviderConfigUsage) *ProviderConfigUsageTracker
NewProviderConfigUsageTracker creates a ProviderConfigUsageTracker.
func (*ProviderConfigUsageTracker) Track ¶
func (u *ProviderConfigUsageTracker) Track(ctx context.Context, mg ModernManaged) error
Track that the supplied Managed resource is using the ProviderConfig it references by creating or updating a ProviderConfigUsage. Track should be called _before_ attempting to use the ProviderConfig. This ensures the managed resource's usage is updated if the managed resource is updated to reference a misconfigured ProviderConfig.
type RateLimitingInterface ¶
type RateLimitingInterface = workqueue.TypedRateLimitingInterface[reconcile.Request]
RateLimitingInterface for an EnqueueRequestForProviderConfig.
type ReconciliationObserver ¶
type ReconciliationObserver interface {
SetObservedGeneration(generation int64)
GetObservedGeneration() int64
}
ReconciliationObserver can track data observed by resource reconciler.
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
type RequiredProviderConfigReferencer ¶
type RequiredProviderConfigReferencer interface {
GetProviderConfigReference() xpv1.Reference
SetProviderConfigReference(p xpv1.Reference)
}
A RequiredProviderConfigReferencer may reference a provider config resource. Unlike ProviderConfigReferencer, the reference is required (i.e. not nil).
type RequiredTypedProviderConfigReferencer ¶
type RequiredTypedProviderConfigReferencer interface {
GetProviderConfigReference() xpv1.ProviderConfigReference
SetProviderConfigReference(p xpv1.ProviderConfigReference)
}
A RequiredTypedProviderConfigReferencer may reference a provider config resource. Unlike TypedProviderConfigReferencer, the reference is required (i.e. not nil).
type RequiredTypedResourceReferencer ¶
type RequiredTypedResourceReferencer interface {
SetResourceReference(r xpv1.TypedReference)
GetResourceReference() xpv1.TypedReference
}
A RequiredTypedResourceReferencer can reference a resource.
type Tracker ¶
type Tracker interface {
// Track the supplied managed resource.
Track(ctx context.Context, mg Managed) error
}
A Tracker tracks managed resources.
type TypedProviderConfigReferencer ¶
type TypedProviderConfigReferencer interface {
GetProviderConfigReference() *xpv1.ProviderConfigReference
SetProviderConfigReference(p *xpv1.ProviderConfigReference)
}
A TypedProviderConfigReferencer may reference a provider config resource with its kind.
type TypedProviderConfigUsage ¶
type TypedProviderConfigUsage interface {
ProviderConfigUsage
RequiredTypedProviderConfigReferencer
}
A TypedProviderConfigUsage is a ProviderConfigUsage that has a typed reference to the ProviderConfig.
type UserCounter ¶
A UserCounter can count how many users it has.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package fake provides fake Crossplane resources for use in tests.
|
Package fake provides fake Crossplane resources for use in tests. |
|
Package unstructured contains utilities unstructured Kubernetes objects.
|
Package unstructured contains utilities unstructured Kubernetes objects. |
|
claim
Package claim contains an unstructured composite resource claim.
|
Package claim contains an unstructured composite resource claim. |
|
composed
Package composed contains an unstructured composed resource.
|
Package composed contains an unstructured composed resource. |
|
composite
Package composite contains an unstructured composite resource.
|
Package composite contains an unstructured composite resource. |
|
reference
Package reference contains references to resources.
|
Package reference contains references to resources. |