resource

package
Version: v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2022 License: Apache-2.0 Imports: 23 Imported by: 967

Documentation

Overview

Package resource provides types and functions that can be used to build Kubernetes controllers that reconcile Crossplane resources.

Index

Constants

View Source
const (
	ExternalResourceTagKeyKind     = "crossplane-kind"
	ExternalResourceTagKeyName     = "crossplane-name"
	ExternalResourceTagKeyProvider = "crossplane-providerconfig"
)

External resources are tagged/labelled with the following keys in the cloud provider API if the type supports.

View Source
const SecretTypeConnection corev1.SecretType = "connection.crossplane.io/v1alpha1"

SecretTypeConnection is the type of Crossplane connection secrets.

Variables

This section is empty.

Functions

func Apply deprecated

func Apply(ctx context.Context, c client.Client, 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.

Deprecated: use APIPatchingApplicator instead.

func CommonCredentialExtractor added in v0.13.0

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 ExtractEnv added in v0.13.0

ExtractEnv extracts credentials from an environment variable.

func ExtractFs added in v0.13.0

func ExtractFs(ctx context.Context, fs afero.Fs, s xpv1.CommonCredentialSelectors) ([]byte, error)

ExtractFs extracts credentials from the filesystem.

func ExtractSecret added in v0.13.0

func ExtractSecret(ctx context.Context, client client.Client, s xpv1.CommonCredentialSelectors) ([]byte, error)

ExtractSecret extracts credentials from a Kubernetes secret.

func GetExternalTags

func GetExternalTags(mg Managed) map[string]string

GetExternalTags returns the identifying tags to be used to tag the external resource in provider API.

func GetKind

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

func Ignore(is ErrorIs, err error) error

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.13.0

func IgnoreAny(err error, is ...ErrorIs) error

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

func IgnoreNotFound(err error) error

IgnoreNotFound returns the supplied error, or nil if the error indicates a Kubernetes resource was not found.

func IsAPIError added in v0.12.0

func IsAPIError(err error) bool

IsAPIError returns true if the given error's type is of Kubernetes API error.

func IsAPIErrorWrapped added in v0.14.0

func IsAPIErrorWrapped(err error) bool

IsAPIErrorWrapped returns true if err is a K8s API error, or recursively wraps a K8s API error

func IsConditionTrue

func IsConditionTrue(c xpv1.Condition) bool

IsConditionTrue returns if condition status is true

func IsMissingReference added in v0.10.0

func IsMissingReference(err error) bool

IsMissingReference returns true if an error indicates that a managed resource is missing a required reference..

func IsNotAllowed added in v0.10.0

func IsNotAllowed(err error) bool

IsNotAllowed returns true if the supplied error indicates that an operation was not allowed.

func IsNotControllable added in v0.10.0

func IsNotControllable(err error) bool

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

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 added in v0.16.0

func NewNotAllowed(message string) error

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.

Types

type APIConnectionPropagator added in v0.8.0

type APIConnectionPropagator struct {
	// contains filtered or unexported fields
}

An APIConnectionPropagator propagates connection details by reading them from and writing them to a Kubernetes API server. Deprecated: This functionality will be removed soon.

func NewAPIConnectionPropagator added in v0.8.0

func NewAPIConnectionPropagator(c client.Client, t runtime.ObjectTyper) *APIConnectionPropagator

NewAPIConnectionPropagator returns a new APIConnectionPropagator. Deprecated: This functionality will be removed soon.

func (*APIConnectionPropagator) PropagateConnection added in v0.8.0

PropagateConnection details from the supplied resource.

type APIFinalizer added in v0.8.0

type APIFinalizer struct {
	// contains filtered or unexported fields
}

An APIFinalizer adds and removes finalizers to and from a resource.

func NewAPIFinalizer added in v0.8.0

func NewAPIFinalizer(c client.Client, finalizer string) *APIFinalizer

NewAPIFinalizer returns a new APIFinalizer.

func (*APIFinalizer) AddFinalizer added in v0.8.0

func (a *APIFinalizer) AddFinalizer(ctx context.Context, obj Object) error

AddFinalizer to the supplied Managed resource.

func (*APIFinalizer) RemoveFinalizer added in v0.8.0

func (a *APIFinalizer) RemoveFinalizer(ctx context.Context, obj Object) error

RemoveFinalizer from the supplied Managed resource.

type APIManagedConnectionPropagator

type APIManagedConnectionPropagator struct {
	Propagator ConnectionPropagator
}

An APIManagedConnectionPropagator propagates connection details by reading them from and writing them to a Kubernetes API server. Deprecated: This functionality will be removed soon.

func (*APIManagedConnectionPropagator) PropagateConnection

PropagateConnection details from the supplied resource.

type APIPatchingApplicator added in v0.7.0

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.7.0

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.7.0

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.7.0

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.7.0

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.7.0

Apply changes to the supplied object. The object will be created if it does not exist, or updated if it does.

type Applicator

type Applicator interface {
	Apply(context.Context, client.Object, ...ApplyOption) error
}

An Applicator applies changes to an object.

type ApplicatorWithRetry added in v0.14.0

type ApplicatorWithRetry struct {
	Applicator
	// contains filtered or unexported fields
}

An ApplicatorWithRetry applies changes to an object, retrying on transient failures

func NewApplicatorWithRetry added in v0.14.0

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 added in v0.14.0

func (awr *ApplicatorWithRetry) Apply(ctx context.Context, c client.Object, opts ...ApplyOption) error

Apply invokes nested Applicator's Apply retrying on designated errors

type ApplyFn

type ApplyFn func(context.Context, client.Object, ...ApplyOption) error

An ApplyFn is a function that satisfies the Applicator interface.

func (ApplyFn) Apply

func (fn ApplyFn) Apply(ctx context.Context, o client.Object, ao ...ApplyOption) error

Apply changes to the supplied object.

type ApplyOption

type ApplyOption func(ctx context.Context, current, desired runtime.Object) error

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 added in v0.10.0

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 added in v0.7.0

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 added in v0.7.0

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.9.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 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

type CanReference runtime.Object

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 *corev1.ObjectReference)
	GetClaimReference() *corev1.ObjectReference
}

A ClaimReferencer may reference a resource claim.

type ClientApplicator added in v0.7.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 Composed added in v0.8.0

Composed resources can be a composed into a Composite resource.

type ComposedResourcesReferencer added in v0.8.0

type ComposedResourcesReferencer interface {
	SetResourceReferences([]corev1.ObjectReference)
	GetResourceReferences() []corev1.ObjectReference
}

A ComposedResourcesReferencer may reference the resources it composes.

type CompositeClaimKind added in v0.10.0

type CompositeClaimKind schema.GroupVersionKind

A CompositeClaimKind contains the type metadata for a kind of composite resource claim.

type CompositeKind added in v0.8.0

type CompositeKind schema.GroupVersionKind

A CompositeKind contains the type metadata for a kind of composite resource.

type CompositeResourceReferencer added in v0.8.0

type CompositeResourceReferencer interface {
	SetResourceReference(r *corev1.ObjectReference)
	GetResourceReference() *corev1.ObjectReference
}

A CompositeResourceReferencer can reference a composite resource.

type CompositionReferencer added in v0.8.0

type CompositionReferencer interface {
	SetCompositionReference(*corev1.ObjectReference)
	GetCompositionReference() *corev1.ObjectReference
}

A CompositionReferencer may reference a composition of resources.

type CompositionRevisionReferencer added in v0.15.0

type CompositionRevisionReferencer interface {
	SetCompositionRevisionReference(*corev1.ObjectReference)
	GetCompositionRevisionReference() *corev1.ObjectReference
}

A CompositionRevisionReferencer may reference a specific revision of a composition of resources.

type CompositionSelector added in v0.8.0

type CompositionSelector interface {
	SetCompositionSelector(*metav1.LabelSelector)
	GetCompositionSelector() *metav1.LabelSelector
}

A CompositionSelector may select a composition of resources.

type CompositionUpdater added in v0.15.0

type CompositionUpdater interface {
	SetCompositionUpdatePolicy(*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(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 added in v0.11.0

type ConnectionDetailsPublishedTimer interface {
	SetConnectionDetailsLastPublishedTime(t *metav1.Time)
	GetConnectionDetailsLastPublishedTime() *metav1.Time
}

A ConnectionDetailsPublishedTimer can record the last time its connection details were published.

type ConnectionDetailsPublisherTo added in v0.16.0

type ConnectionDetailsPublisherTo interface {
	SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo)
	GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo
}

A ConnectionDetailsPublisherTo may write a connection details secret to a secret store

type ConnectionPropagator added in v0.8.0

type ConnectionPropagator interface {
	PropagateConnection(ctx context.Context, to LocalConnectionSecretOwner, from ConnectionSecretOwner) error
}

A ConnectionPropagator is responsible for propagating information required to connect to a resource. Deprecated: This functionality will be removed soon.

type ConnectionPropagatorFn added in v0.8.0

type ConnectionPropagatorFn func(ctx context.Context, to LocalConnectionSecretOwner, from ConnectionSecretOwner) error

A ConnectionPropagatorFn is a function that satisfies the

ConnectionPropagator interface.

type ConnectionSecretOwner

type ConnectionSecretOwner interface {
	Object

	ConnectionSecretWriterTo
	ConnectionDetailsPublisherTo
}

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 added in v0.10.0

type EnqueueRequestForProviderConfig struct{}

EnqueueRequestForProviderConfig enqueues a reconcile.Request for a referenced ProviderConfig.

func (*EnqueueRequestForProviderConfig) Create added in v0.10.0

Create adds a NamespacedName for the supplied CreateEvent if its Object is a ProviderConfigReferencer.

func (*EnqueueRequestForProviderConfig) Delete added in v0.10.0

Delete adds a NamespacedName for the supplied DeleteEvent if its Object is a ProviderConfigReferencer.

func (*EnqueueRequestForProviderConfig) Generic added in v0.10.0

Generic adds a NamespacedName for the supplied GenericEvent if its Object is a ProviderConfigReferencer.

func (*EnqueueRequestForProviderConfig) Update added in v0.10.0

Update adds a NamespacedName for the supplied UpdateEvent if its Objects are a ProviderConfigReferencer.

type EnvLookupFn added in v0.13.0

type EnvLookupFn func(string) string

EnvLookupFn looks up an environment variable.

type ErrorIs

type ErrorIs func(err error) bool

An ErrorIs function returns true if an error satisfies a particular condition.

type Finalizer added in v0.8.0

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 added in v0.16.0

func NewNopFinalizer() Finalizer

NewNopFinalizer returns a Finalizer that does nothing.

type FinalizerFns added in v0.8.0

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 added in v0.8.0

func (f FinalizerFns) AddFinalizer(ctx context.Context, obj Object) error

AddFinalizer to the supplied resource.

func (FinalizerFns) RemoveFinalizer added in v0.8.0

func (f FinalizerFns) RemoveFinalizer(ctx context.Context, obj Object) error

RemoveFinalizer from the supplied resource.

type LateInitializer added in v0.14.0

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 added in v0.14.0

func NewLateInitializer() *LateInitializer

NewLateInitializer returns a new instance of *LateInitializer.

func (*LateInitializer) IsChanged added in v0.14.0

func (li *LateInitializer) IsChanged() bool

IsChanged reports whether the second argument is ever used in late initialization function calls.

func (*LateInitializer) LateInitializeBoolPtr added in v0.14.0

func (li *LateInitializer) LateInitializeBoolPtr(org *bool, from *bool) *bool

LateInitializeBoolPtr implements late initialization for *bool.

func (*LateInitializer) LateInitializeInt64Ptr added in v0.14.0

func (li *LateInitializer) LateInitializeInt64Ptr(org *int64, from *int64) *int64

LateInitializeInt64Ptr implements late initialization for *int64.

func (*LateInitializer) LateInitializeStringPtr added in v0.14.0

func (li *LateInitializer) LateInitializeStringPtr(org *string, from *string) *string

LateInitializeStringPtr implements late initialization for *string.

func (*LateInitializer) LateInitializeTimePtr added in v0.14.0

func (li *LateInitializer) LateInitializeTimePtr(org *metav1.Time, from *time.Time) *metav1.Time

LateInitializeTimePtr implements late initialization for *metav1.Time from *time.Time.

func (*LateInitializer) SetChanged added in v0.14.0

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 LocalConnectionSecretOwner

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 Managed

A Managed is a Kubernetes object representing a concrete managed resource (e.g. a CloudSQL instance).

type ManagedConnectionPropagator

type ManagedConnectionPropagator interface {
	PropagateConnection(ctx context.Context, o LocalConnectionSecretOwner, mg Managed) error
}

A ManagedConnectionPropagator is responsible for propagating information required to connect to a managed resource (for example the connection secret) from the managed resource to a target. Deprecated: This functionality will be removed soon.

type ManagedConnectionPropagatorFn

type ManagedConnectionPropagatorFn func(ctx context.Context, o LocalConnectionSecretOwner, mg Managed) error

A ManagedConnectionPropagatorFn is a function that satisfies the ManagedConnectionPropagator interface.

func (ManagedConnectionPropagatorFn) PropagateConnection

PropagateConnection information from the supplied managed resource to the supplied resource claim.

type ManagedKind

type ManagedKind schema.GroupVersionKind

A ManagedKind contains the type metadata for a kind of managed resource.

type ManagedList added in v0.8.0

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 Object

type Object interface {
	metav1.Object
	runtime.Object
}

An Object is a Kubernetes object.

type Orphanable added in v0.10.0

type Orphanable interface {
	SetDeletionPolicy(p xpv1.DeletionPolicy)
	GetDeletionPolicy() xpv1.DeletionPolicy
}

An Orphanable resource may specify a DeletionPolicy.

type PredicateFn

type PredicateFn func(obj runtime.Object) bool

A PredicateFn returns true if the supplied object should be reconciled.

func AllOf

func AllOf(fn ...PredicateFn) PredicateFn

AllOf accepts objects that pass all of the supplied predicate functions.

func AnyOf

func AnyOf(fn ...PredicateFn) PredicateFn

AnyOf accepts objects that pass any of the supplied predicate functions.

func HasManagedResourceReferenceKind

func HasManagedResourceReferenceKind(k ManagedKind) PredicateFn

HasManagedResourceReferenceKind accepts objects that reference the supplied managed resource kind.

func IsControlledByKind

func IsControlledByKind(k schema.GroupVersionKind) PredicateFn

IsControlledByKind accepts objects that are controlled by a resource of the supplied kind.

func IsManagedKind

func IsManagedKind(k ManagedKind, ot runtime.ObjectTyper) PredicateFn

IsManagedKind accepts objects that are of the supplied managed resource kind.

func IsNamed added in v0.14.0

func IsNamed(name string) PredicateFn

IsNamed accepts objects that is named as the given name.

func IsPropagated

func IsPropagated() PredicateFn

IsPropagated accepts objects that consent to be partially or fully propagated from another object of the same kind.

func IsPropagator

func IsPropagator() PredicateFn

IsPropagator accepts objects that request to be partially or fully propagated to another object of the same kind.

type ProviderConfig added in v0.10.0

type ProviderConfig interface {
	Object

	UserCounter
	Conditioned
}

A ProviderConfig configures a Crossplane provider.

type ProviderConfigKinds added in v0.10.0

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 added in v0.10.0

type ProviderConfigReferencer interface {
	GetProviderConfigReference() *xpv1.Reference
	SetProviderConfigReference(p *xpv1.Reference)
}

A ProviderConfigReferencer may reference a provider config resource.

type ProviderConfigUsage added in v0.10.0

A ProviderConfigUsage indicates a usage of a Crossplane provider config.

type ProviderConfigUsageList added in v0.10.0

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 added in v0.10.0

type ProviderConfigUsageTracker struct {
	// contains filtered or unexported fields
}

A ProviderConfigUsageTracker tracks usages of a ProviderConfig by creating or updating the appropriate ProviderConfigUsage.

func NewProviderConfigUsageTracker added in v0.10.0

func NewProviderConfigUsageTracker(c client.Client, of ProviderConfigUsage) *ProviderConfigUsageTracker

NewProviderConfigUsageTracker creates a ProviderConfigUsageTracker.

func (*ProviderConfigUsageTracker) Track added in v0.10.0

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 ProviderReferencer

type ProviderReferencer interface {
	GetProviderReference() *xpv1.Reference
	SetProviderReference(p *xpv1.Reference)
}

A ProviderReferencer may reference a provider resource.

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 added in v0.10.0

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 RequiredTypedResourceReferencer added in v0.10.0

type RequiredTypedResourceReferencer interface {
	SetResourceReference(r xpv1.TypedReference)
	GetResourceReference() xpv1.TypedReference
}

A RequiredTypedResourceReferencer can reference a resource.

type Tracker added in v0.10.0

type Tracker interface {
	// Track the supplied managed resource.
	Track(ctx context.Context, mg Managed) error
}

A Tracker tracks managed resources.

type TrackerFn added in v0.10.0

type TrackerFn func(ctx context.Context, mg Managed) error

A TrackerFn is a function that tracks managed resources.

func (TrackerFn) Track added in v0.10.0

func (fn TrackerFn) Track(ctx context.Context, mg Managed) error

Track the supplied managed resource.

type UserCounter added in v0.10.0

type UserCounter interface {
	SetUsers(i int64)
	GetUsers() int64
}

A UserCounter can count how many users it has.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL