Documentation ¶
Index ¶
- Constants
- func Binding() v1alpha1.Condition
- func ConnectionSecretFor(o ConnectionSecretOwner, kind schema.GroupVersionKind) *corev1.Secret
- func Ignore(is ErrorIs, err error) error
- func IgnoreNotFound(err error) error
- func IsBindable(b Bindable) bool
- func IsBound(b Bindable) bool
- func MustCreateObject(kind schema.GroupVersionKind, oc runtime.ObjectCreater) runtime.Object
- func MustGetKind(obj runtime.Object, ot runtime.ObjectTyper) schema.GroupVersionKind
- func NewPredicates(fn PredicateFn) predicate.Funcs
- func ResolveClassClaimValues(classValue, claimValue string) (string, error)
- func SetBindable(b Bindable)
- type APIClaimFinalizerRemover
- type APIManagedBinder
- type APIManagedConnectionPropagator
- type APIManagedCreator
- type APIManagedFinalizerAdder
- type APIManagedFinalizerRemover
- type APIManagedStatusBinder
- type APIManagedStatusUnbinder
- type APIManagedUnbinder
- type APISecretPublisher
- type Bindable
- type Claim
- type ClaimFinalizer
- type ClaimFinalizerFn
- type ClaimKind
- type ClaimReconciler
- type ClaimReconcilerOption
- func WithClaimFinalizer(f ClaimFinalizer) ClaimReconcilerOption
- func WithManagedBinder(b ManagedBinder) ClaimReconcilerOption
- func WithManagedConfigurators(c ...ManagedConfigurator) ClaimReconcilerOption
- func WithManagedConnectionPropagator(p ManagedConnectionPropagator) ClaimReconcilerOption
- func WithManagedCreator(c ManagedCreator) ClaimReconcilerOption
- func WithManagedFinalizer(f ManagedFinalizer) ClaimReconcilerOption
- type ClaimReferencer
- type Class
- type ClassKind
- type ClassReferencer
- type ConditionSetter
- type ConfiguratorChain
- type ConnectionDetails
- type ConnectionSecretOwner
- type ConnectionSecretWriterTo
- type DefaultClassReconciler
- type DefaultClassReconcilerOption
- type DefaultClassReferencer
- type EnqueueRequestForClaim
- func (e *EnqueueRequestForClaim) Create(evt event.CreateEvent, q workqueue.RateLimitingInterface)
- func (e *EnqueueRequestForClaim) Delete(evt event.DeleteEvent, q workqueue.RateLimitingInterface)
- func (e *EnqueueRequestForClaim) Generic(evt event.GenericEvent, q workqueue.RateLimitingInterface)
- func (e *EnqueueRequestForClaim) Update(evt event.UpdateEvent, q workqueue.RateLimitingInterface)
- type ErrorIs
- type ExternalClient
- type ExternalClientFns
- func (e ExternalClientFns) Create(ctx context.Context, mg Managed) (ExternalCreation, error)
- func (e ExternalClientFns) Delete(ctx context.Context, mg Managed) error
- func (e ExternalClientFns) Observe(ctx context.Context, mg Managed) (ExternalObservation, error)
- func (e ExternalClientFns) Update(ctx context.Context, mg Managed) (ExternalUpdate, error)
- type ExternalConnecter
- type ExternalConnectorFn
- type ExternalCreation
- type ExternalObservation
- type ExternalUpdate
- type Managed
- type ManagedBinder
- type ManagedBinderFn
- type ManagedConfigurator
- type ManagedConfiguratorFn
- type ManagedConnectionPropagator
- type ManagedConnectionPropagatorFn
- type ManagedConnectionPublisher
- type ManagedConnectionPublisherFns
- type ManagedCreator
- type ManagedCreatorFn
- type ManagedEstablisher
- type ManagedEstablisherFn
- type ManagedFinalizer
- type ManagedFinalizerFn
- type ManagedKind
- type ManagedReconciler
- type ManagedReconcilerOption
- type ManagedResourceReferencer
- type NopClient
- func (c *NopClient) Create(ctx context.Context, mg Managed) (ExternalCreation, error)
- func (c *NopClient) Delete(ctx context.Context, mg Managed) error
- func (c *NopClient) Observe(ctx context.Context, mg Managed) (ExternalObservation, error)
- func (c *NopClient) Update(ctx context.Context, mg Managed) (ExternalUpdate, error)
- type NopConnecter
- type ObjectMetaConfigurator
- type Policy
- type PolicyKind
- type PolicyList
- type PredicateFn
- type PublisherChain
- type Reclaimer
Constants ¶
const (
ReasonBinding = "Managed claim is waiting for managed resource to become bindable"
)
Reasons a resource claim is or is not ready.
Variables ¶
This section is empty.
Functions ¶
func Binding ¶
Binding returns a condition that indicates the resource claim is currently waiting for its managed resource to become bindable.
func ConnectionSecretFor ¶
func ConnectionSecretFor(o ConnectionSecretOwner, kind schema.GroupVersionKind) *corev1.Secret
ConnectionSecretFor the supplied ConnectionSecretOwner, assumed to be of the supplied kind.
func Ignore ¶
Ignore any errors that satisfy the supplied ErrorIs function by returning nil. Errors that do not satisfy the suppled function are returned unmodified.
func IgnoreNotFound ¶
IgnoreNotFound returns the supplied error, or nil if the error indicates a Kubernetes resource was not found.
func IsBindable ¶
IsBindable returns true if the supplied Bindable is ready for binding to another Bindable, such as a resource claim or managed resource.
func IsBound ¶
IsBound returns true if the supplied Bindable is bound to another Bindable, such as a resource claim or managed resource.
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 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.
func ResolveClassClaimValues ¶
ResolveClassClaimValues validates the supplied claim value against the supplied resource class value. If both are non-zero they must match.
func SetBindable ¶
func SetBindable(b Bindable)
SetBindable indicates that the supplied Bindable is ready for binding to another Bindable, such as a resource claim or managed resource.
Types ¶
type APIClaimFinalizerRemover ¶
type APIClaimFinalizerRemover struct {
// contains filtered or unexported fields
}
An APIClaimFinalizerRemover finalizes the deletion of a resource claim by removing its finalizer and updating it in the API server.
func NewAPIClaimFinalizerRemover ¶
func NewAPIClaimFinalizerRemover(c client.Client) *APIClaimFinalizerRemover
NewAPIClaimFinalizerRemover returns a new APIClaimFinalizerRemover.
type APIManagedBinder ¶
type APIManagedBinder struct {
// contains filtered or unexported fields
}
An APIManagedBinder binds resources to claims by updating them in a Kubernetes API server. Note that APIManagedBinder does not support objects using the status subresource; such objects should use APIManagedStatusBinder.
func NewAPIManagedBinder ¶
func NewAPIManagedBinder(c client.Client) *APIManagedBinder
NewAPIManagedBinder returns a new APIManagedBinder.
type APIManagedConnectionPropagator ¶
type APIManagedConnectionPropagator struct {
// contains filtered or unexported fields
}
An APIManagedConnectionPropagator propagates connection details by reading them from and writing them to a Kubernetes API server.
func NewAPIManagedConnectionPropagator ¶
func NewAPIManagedConnectionPropagator(c client.Client, t runtime.ObjectTyper) *APIManagedConnectionPropagator
NewAPIManagedConnectionPropagator returns a new APIManagedConnectionPropagator.
func (*APIManagedConnectionPropagator) PropagateConnection ¶
func (a *APIManagedConnectionPropagator) PropagateConnection(ctx context.Context, cm Claim, mg Managed) error
PropagateConnection details from the supplied resource to the supplied claim.
type APIManagedCreator ¶
type APIManagedCreator struct {
// contains filtered or unexported fields
}
An APIManagedCreator creates resources by submitting them to a Kubernetes API server.
func NewAPIManagedCreator ¶
func NewAPIManagedCreator(c client.Client, t runtime.ObjectTyper) *APIManagedCreator
NewAPIManagedCreator returns a new APIManagedCreator.
type APIManagedFinalizerAdder ¶
type APIManagedFinalizerAdder struct {
// contains filtered or unexported fields
}
An APIManagedFinalizerAdder establishes ownership of a managed resource by adding a finalizer and updating it in the API server.
func NewAPIManagedFinalizerAdder ¶
func NewAPIManagedFinalizerAdder(c client.Client) *APIManagedFinalizerAdder
NewAPIManagedFinalizerAdder returns a new APIManagedFinalizerAdder.
type APIManagedFinalizerRemover ¶
type APIManagedFinalizerRemover struct {
// contains filtered or unexported fields
}
An APIManagedFinalizerRemover finalizes the deletion of a Managed resource by removing its finalizer and updating it in the API server.
func NewAPIManagedFinalizerRemover ¶
func NewAPIManagedFinalizerRemover(c client.Client) *APIManagedFinalizerRemover
NewAPIManagedFinalizerRemover returns a new APIManagedFinalizerRemover.
type APIManagedStatusBinder ¶
type APIManagedStatusBinder struct {
// contains filtered or unexported fields
}
An APIManagedStatusBinder binds resources to claims by updating them in a Kubernetes API server. Note that APIManagedStatusBinder does not support objects that do not use the status subresource; such objects should use APIManagedBinder.
func NewAPIManagedStatusBinder ¶
func NewAPIManagedStatusBinder(c client.Client) *APIManagedStatusBinder
NewAPIManagedStatusBinder returns a new APIManagedStatusBinder.
type APIManagedStatusUnbinder ¶
type APIManagedStatusUnbinder struct {
// contains filtered or unexported fields
}
An APIManagedStatusUnbinder finalizes the deletion of a managed resource by unbinding it, then updating it and its status in the API server.
func NewAPIManagedStatusUnbinder ¶
func NewAPIManagedStatusUnbinder(c client.Client) *APIManagedStatusUnbinder
NewAPIManagedStatusUnbinder returns a new APIStatusManagedFinalizer.
type APIManagedUnbinder ¶
type APIManagedUnbinder struct {
// contains filtered or unexported fields
}
An APIManagedUnbinder finalizes the deletion of a managed resource by unbinding it, then updating it in the API server.
func NewAPIManagedUnbinder ¶
func NewAPIManagedUnbinder(c client.Client) *APIManagedUnbinder
NewAPIManagedUnbinder returns a new APIManagedUnbinder.
type APISecretPublisher ¶
type APISecretPublisher struct {
// contains filtered or unexported fields
}
An APISecretPublisher publishes ConnectionDetails by submitting a Secret to a Kubernetes API server.
func NewAPISecretPublisher ¶
func NewAPISecretPublisher(c client.Client, ot runtime.ObjectTyper) *APISecretPublisher
NewAPISecretPublisher returns a new APISecretPublisher.
func (*APISecretPublisher) PublishConnection ¶
func (a *APISecretPublisher) PublishConnection(ctx context.Context, mg Managed, c ConnectionDetails) error
PublishConnection publishes the supplied ConnectionDetails to a Secret in the same namespace as the supplied Managed resource. Applying is a no-op if the secret already exists with the supplied ConnectionDetails.
func (*APISecretPublisher) UnpublishConnection ¶
func (a *APISecretPublisher) UnpublishConnection(ctx context.Context, mg Managed, c ConnectionDetails) error
UnpublishConnection is no-op since PublishConnection only creates resources that will be garbage collected by Kubernetes when the managed resource is deleted.
type Bindable ¶
type Bindable interface { SetBindingPhase(p v1alpha1.BindingPhase) GetBindingPhase() v1alpha1.BindingPhase }
A Bindable resource may be bound to another resource. Resources are bindable when they available for use.
type Claim ¶
type Claim interface { runtime.Object metav1.Object ClassReferencer ManagedResourceReferencer ConnectionSecretWriterTo ConditionSetter Bindable }
A Claim is a Kubernetes object representing an abstract resource claim (e.g. an SQL database) that may be bound to a concrete managed resource (e.g. a CloudSQL instance).
type ClaimFinalizer ¶
A ClaimFinalizer finalizes the deletion of a resource claim.
type ClaimFinalizerFn ¶
A ClaimFinalizerFn is a function that sastisfies the ClaimFinalizer interface.
type ClaimKind ¶
type ClaimKind schema.GroupVersionKind
A ClaimKind contains the type metadata for a kind of resource claim.
type ClaimReconciler ¶
type ClaimReconciler struct {
// contains filtered or unexported fields
}
A ClaimReconciler reconciles resource claims by creating exactly one kind of concrete managed resource. Each resource claim kind should create an instance of this controller for each managed resource kind they can bind to, using watch predicates to ensure each controller is responsible for exactly one type of resource class provisioner. Each controller must watch its subset of resource claims and any managed resources they control.
func NewClaimReconciler ¶
func NewClaimReconciler(m manager.Manager, of ClaimKind, using ClassKind, with ManagedKind, o ...ClaimReconcilerOption) *ClaimReconciler
NewClaimReconciler returns a ClaimReconciler that reconciles resource claims of the supplied ClaimKind with resources of the supplied ManagedKind. It panics if asked to reconcile a claim or resource kind that is not registered with the supplied manager's runtime.Scheme. The returned ClaimReconciler will apply only the ObjectMetaConfigurator by default; most callers should supply one or more ManagedConfigurators to configure their managed resources.
type ClaimReconcilerOption ¶
type ClaimReconcilerOption func(*ClaimReconciler)
A ClaimReconcilerOption configures a Reconciler.
func WithClaimFinalizer ¶
func WithClaimFinalizer(f ClaimFinalizer) ClaimReconcilerOption
WithClaimFinalizer specifies which ClaimFinalizer should be used to finalize claims when they are deleted.
func WithManagedBinder ¶
func WithManagedBinder(b ManagedBinder) ClaimReconcilerOption
WithManagedBinder specifies which ManagedBinder should be used to bind resources to their claim.
func WithManagedConfigurators ¶
func WithManagedConfigurators(c ...ManagedConfigurator) ClaimReconcilerOption
WithManagedConfigurators specifies which configurators should be used to configure each managed resource. Configurators will be applied in the order they are specified.
func WithManagedConnectionPropagator ¶
func WithManagedConnectionPropagator(p ManagedConnectionPropagator) ClaimReconcilerOption
WithManagedConnectionPropagator specifies which ManagedConnectionPropagator should be used to propagate resource connection details to their claim.
func WithManagedCreator ¶
func WithManagedCreator(c ManagedCreator) ClaimReconcilerOption
WithManagedCreator specifies which ManagedCreator should be used to create managed resources.
func WithManagedFinalizer ¶
func WithManagedFinalizer(f ManagedFinalizer) ClaimReconcilerOption
WithManagedFinalizer specifies which ManagedFinalizer should be used to finalize managed resources when their claims are deleted.
type ClaimReferencer ¶
type ClaimReferencer interface { SetClaimReference(r *corev1.ObjectReference) GetClaimReference() *corev1.ObjectReference }
A ClaimReferencer may reference a resource claim.
type Class ¶
A Class is a Kubernetes object representing configuration specifications for a manged resource.
type ClassKind ¶
type ClassKind schema.GroupVersionKind
A ClassKind contains the type metadata for a kind of resource class.
type ClassReferencer ¶
type ClassReferencer interface { SetClassReference(r *corev1.ObjectReference) GetClassReference() *corev1.ObjectReference }
A ClassReferencer may reference a resource class.
type ConditionSetter ¶
A ConditionSetter may have conditions set. Conditions are informational, and typically indicate the status of both a resource and its reconciliation process.
type ConfiguratorChain ¶
type ConfiguratorChain []ManagedConfigurator
A ConfiguratorChain chains multiple configurators.
type ConnectionDetails ¶
ConnectionDetails created or updated during an operation on an external resource, for example usernames, passwords, endpoints, ports, etc.
type ConnectionSecretOwner ¶
type ConnectionSecretOwner interface { metav1.Object ConnectionSecretWriterTo }
A ConnectionSecretOwner may create and manage a connection secret.
type ConnectionSecretWriterTo ¶
type ConnectionSecretWriterTo interface { SetWriteConnectionSecretToReference(r corev1.LocalObjectReference) GetWriteConnectionSecretToReference() corev1.LocalObjectReference }
A ConnectionSecretWriterTo may write a connection secret.
type DefaultClassReconciler ¶
type DefaultClassReconciler struct {
// contains filtered or unexported fields
}
DefaultClassReconciler reconciles resource claims to the default resource class for their given kind according to existing policies. Predicates ensure that only claims with no resource class reference are reconciled.
func NewDefaultClassReconciler ¶
func NewDefaultClassReconciler(m manager.Manager, of ClaimKind, by PolicyKind, o ...DefaultClassReconcilerOption) *DefaultClassReconciler
NewDefaultClassReconciler creates a new DefaultReconciler for the claim kind.
type DefaultClassReconcilerOption ¶
type DefaultClassReconcilerOption func(*DefaultClassReconciler)
A DefaultClassReconcilerOption configures a DefaultClassReconciler.
func WithObjectConverter ¶
func WithObjectConverter(oc runtime.ObjectConvertor) DefaultClassReconcilerOption
WithObjectConverter specifies how the DefaultClassReconciler should convert an *UnstructuredList into a concrete list type.
type DefaultClassReferencer ¶
type DefaultClassReferencer interface { SetDefaultClassReference(r *corev1.ObjectReference) GetDefaultClassReference() *corev1.ObjectReference }
A DefaultClassReferencer may reference a default resource class.
type EnqueueRequestForClaim ¶
type EnqueueRequestForClaim struct{}
EnqueueRequestForClaim enqueues a reconcile.Request for the NamespacedName of a ClaimReferencer's ClaimReference.
func (*EnqueueRequestForClaim) Create ¶
func (e *EnqueueRequestForClaim) Create(evt event.CreateEvent, q workqueue.RateLimitingInterface)
Create adds a NamespacedName for the supplied CreateEvent if its Object is a ClaimReferencer.
func (*EnqueueRequestForClaim) Delete ¶
func (e *EnqueueRequestForClaim) Delete(evt event.DeleteEvent, q workqueue.RateLimitingInterface)
Delete adds a NamespacedName for the supplied DeleteEvent if its Object is a ClaimReferencer.
func (*EnqueueRequestForClaim) Generic ¶
func (e *EnqueueRequestForClaim) Generic(evt event.GenericEvent, q workqueue.RateLimitingInterface)
Generic adds a NamespacedName for the supplied GenericEvent if its Object is a ClaimReferencer.
func (*EnqueueRequestForClaim) Update ¶
func (e *EnqueueRequestForClaim) Update(evt event.UpdateEvent, q workqueue.RateLimitingInterface)
Update adds a NamespacedName for the supplied UpdateEvent if its Objects are ClaimReferencers.
type ExternalClient ¶
type ExternalClient interface { // Observe the external resource the supplied Managed resource represents, // if any. Observe implementations must not modify the external resource, // but may update the supplied Managed resource to reflect the state of the // external resource. Observe(ctx context.Context, mg Managed) (ExternalObservation, error) // Create an external resource per the specifications of the supplied // Managed resource. Create(ctx context.Context, mg Managed) (ExternalCreation, error) // Update the external resource represented by the supplied Managed // resource, if necessary. Update implementations must handle the case in // which no update is necessary. Update(ctx context.Context, mg Managed) (ExternalUpdate, error) // Delete the external resource upon deletion of its associated Managed // resource. Delete(ctx context.Context, mg Managed) error }
An ExternalClient manages the lifecycle of an external resource. None of the calls here should be blocking. All of the calls should be idempotent. For example, Create call should not return AlreadyExists error if it's called again with the same parameters or Delete call should not return error if there is an ongoing deletion or resource does not exist.
type ExternalClientFns ¶
type ExternalClientFns struct { ObserveFn func(ctx context.Context, mg Managed) (ExternalObservation, error) CreateFn func(ctx context.Context, mg Managed) (ExternalCreation, error) UpdateFn func(ctx context.Context, mg Managed) (ExternalUpdate, error) DeleteFn func(ctx context.Context, mg Managed) error }
ExternalClientFns is the pluggable struct to produce an ExternalClient from given functions.
func (ExternalClientFns) Create ¶
func (e ExternalClientFns) Create(ctx context.Context, mg Managed) (ExternalCreation, error)
Create calls plugged CreateFn function.
func (ExternalClientFns) Delete ¶
func (e ExternalClientFns) Delete(ctx context.Context, mg Managed) error
Delete calls plugged DeleteFn function.
func (ExternalClientFns) Observe ¶
func (e ExternalClientFns) Observe(ctx context.Context, mg Managed) (ExternalObservation, error)
Observe calls plugged ObserveFn function.
func (ExternalClientFns) Update ¶
func (e ExternalClientFns) Update(ctx context.Context, mg Managed) (ExternalUpdate, error)
Update calls plugged UpdateFn function.
type ExternalConnecter ¶
type ExternalConnecter interface {
Connect(ctx context.Context, mg Managed) (ExternalClient, error)
}
An ExternalConnecter produces a new ExternalClient given the supplied Managed resource.
type ExternalConnectorFn ¶
type ExternalConnectorFn func(ctx context.Context, mg Managed) (ExternalClient, error)
ExternalConnectorFn is the pluggable struct to produce an ExternalConnector from given functions.
func (ExternalConnectorFn) Connect ¶
func (ec ExternalConnectorFn) Connect(ctx context.Context, mg Managed) (ExternalClient, error)
Connect calls plugged ExternalConnectorFn function.
type ExternalCreation ¶
type ExternalCreation struct {
ConnectionDetails ConnectionDetails
}
An ExternalCreation is the result of the creation of an external resource.
type ExternalObservation ¶
type ExternalObservation struct { ResourceExists bool ConnectionDetails ConnectionDetails }
An ExternalObservation is the result of an observation of an external resource.
type ExternalUpdate ¶
type ExternalUpdate struct {
ConnectionDetails ConnectionDetails
}
An ExternalUpdate is the result of an update to an external resource.
type Managed ¶
type Managed interface { runtime.Object metav1.Object ClassReferencer ClaimReferencer ConnectionSecretWriterTo Reclaimer ConditionSetter Bindable }
A Managed is a Kubernetes object representing a concrete managed resource (e.g. a CloudSQL instance).
type ManagedBinder ¶
A ManagedBinder binds a resource claim to a managed resource.
type ManagedBinderFn ¶
A ManagedBinderFn is a function that sastisfies the ManagedBinder interface.
type ManagedConfigurator ¶
type ManagedConfigurator interface {
Configure(ctx context.Context, cm Claim, cs Class, mg Managed) error
}
A ManagedConfigurator configures a resource, typically by converting it to a known type and populating its spec.
type ManagedConfiguratorFn ¶
A ManagedConfiguratorFn is a function that sastisfies the ManagedConfigurator interface.
type ManagedConnectionPropagator ¶
type ManagedConnectionPropagator interface {
PropagateConnection(ctx context.Context, cm Claim, 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 its resource claim.
type ManagedConnectionPropagatorFn ¶
A ManagedConnectionPropagatorFn is a function that sastisfies the ManagedConnectionPropagator interface.
func (ManagedConnectionPropagatorFn) PropagateConnection ¶
func (fn ManagedConnectionPropagatorFn) PropagateConnection(ctx context.Context, cm Claim, mg Managed) error
PropagateConnection information from the supplied managed resource to the supplied resource claim.
type ManagedConnectionPublisher ¶
type ManagedConnectionPublisher interface { PublishConnection(ctx context.Context, mg Managed, c ConnectionDetails) error UnpublishConnection(ctx context.Context, mg Managed, c ConnectionDetails) error }
A ManagedConnectionPublisher manages the supplied ConnectionDetails for the supplied Managed resource. ManagedPublishers must handle the case in which the supplied ConnectionDetails are empty.
type ManagedConnectionPublisherFns ¶
type ManagedConnectionPublisherFns struct { PublishConnectionFn func(ctx context.Context, mg Managed, c ConnectionDetails) error UnpublishConnectionFn func(ctx context.Context, mg Managed, c ConnectionDetails) error }
ManagedConnectionPublisherFns is the pluggable struct to produce objects with ManagedConnectionPublisher interface.
func (ManagedConnectionPublisherFns) PublishConnection ¶
func (fn ManagedConnectionPublisherFns) PublishConnection(ctx context.Context, mg Managed, c ConnectionDetails) error
PublishConnection calls plugged PublishConnectionFn.
func (ManagedConnectionPublisherFns) UnpublishConnection ¶
func (fn ManagedConnectionPublisherFns) UnpublishConnection(ctx context.Context, mg Managed, c ConnectionDetails) error
UnpublishConnection calls plugged UnpublishConnectionFn.
type ManagedCreator ¶
A ManagedCreator creates a resource, typically by submitting it to an API server. ManagedCreators must not modify the supplied resource class, but are responsible for final modifications to the claim and resource, for example ensuring resource, class, claim, and owner references are set.
type ManagedCreatorFn ¶
A ManagedCreatorFn is a function that sastisfies the ManagedCreator interface.
type ManagedEstablisher ¶
A ManagedEstablisher establishes ownership of the supplied Managed resource. This typically involves adding a finalizer to the object metadata.
type ManagedEstablisherFn ¶
ManagedEstablisherFn is the pluggable struct to produce objects with ManagedEstablisher interface.
type ManagedFinalizer ¶
A ManagedFinalizer finalizes the deletion of a resource claim.
type ManagedFinalizerFn ¶
A ManagedFinalizerFn is a function that sastisfies the ManagedFinalizer interface.
type ManagedKind ¶
type ManagedKind schema.GroupVersionKind
A ManagedKind contains the type metadata for a kind of managed resource.
type ManagedReconciler ¶
type ManagedReconciler struct {
// contains filtered or unexported fields
}
A ManagedReconciler reconciles managed resources by creating and managing the lifecycle of an external resource, i.e. a resource in an external system such as a cloud provider API. Each controller must watch the managed resource kind for which it is responsible.
func NewManagedReconciler ¶
func NewManagedReconciler(m manager.Manager, of ManagedKind, o ...ManagedReconcilerOption) *ManagedReconciler
NewManagedReconciler returns a ManagedReconciler that reconciles managed resources of the supplied ManagedKind with resources in an external system such as a cloud provider API. It panics if asked to reconcile a managed resource kind that is not registered with the supplied manager's runtime.Scheme. The returned ManagedReconciler reconciles with a dummy, no-op 'external system' by default; callers should supply an ExternalConnector that returns an ExternalClient capable of managing resources in a real system.
type ManagedReconcilerOption ¶
type ManagedReconcilerOption func(*ManagedReconciler)
A ManagedReconcilerOption configures a ManagedReconciler.
func WithExternalConnecter ¶
func WithExternalConnecter(c ExternalConnecter) ManagedReconcilerOption
WithExternalConnecter specifies how the Reconciler should connect to the API used to sync and delete external resources.
func WithLongWait ¶
func WithLongWait(after time.Duration) ManagedReconcilerOption
WithLongWait specifies how long the ManagedReconciler should wait before queueing a new reconciliation in 'long wait' scenarios. The Reconciler requeues after a long wait when it is not actively waiting for an external operation, but wishes to check whether an existing external resource needs to be synced to its Crossplane Managed resource.
func WithManagedConnectionPublishers ¶
func WithManagedConnectionPublishers(p ...ManagedConnectionPublisher) ManagedReconcilerOption
WithManagedConnectionPublishers specifies how the Reconciler should publish its connection details such as credentials and endpoints.
func WithShortWait ¶
func WithShortWait(after time.Duration) ManagedReconcilerOption
WithShortWait specifies how long the ManagedReconciler should wait before queueing a new reconciliation in 'short wait' scenarios. The Reconciler requeues after a short wait when it knows it is waiting for an external operation to complete, or when it encounters a potentially temporary error.
type ManagedResourceReferencer ¶
type ManagedResourceReferencer interface { SetResourceReference(r *corev1.ObjectReference) GetResourceReference() *corev1.ObjectReference }
A ManagedResourceReferencer may reference a concrete managed resource.
type NopClient ¶
type NopClient struct{}
A NopClient does nothing.
type NopConnecter ¶
type NopConnecter struct{}
A NopConnecter does nothing.
func (*NopConnecter) Connect ¶
func (c *NopConnecter) Connect(_ context.Context, _ Managed) (ExternalClient, error)
Connect returns a NopClient. It never returns an error.
type ObjectMetaConfigurator ¶
type ObjectMetaConfigurator struct {
// contains filtered or unexported fields
}
An ObjectMetaConfigurator sets standard object metadata for a dynamically provisioned resource, deriving it from a class and claim.
func NewObjectMetaConfigurator ¶
func NewObjectMetaConfigurator(t runtime.ObjectTyper) *ObjectMetaConfigurator
NewObjectMetaConfigurator returns a new ObjectMetaConfigurator.
type Policy ¶
type Policy interface { runtime.Object metav1.Object DefaultClassReferencer }
A Policy is a Kubernetes object representing a default behavior for a given claim kind.
type PolicyKind ¶
type PolicyKind struct { Singular schema.GroupVersionKind Plural schema.GroupVersionKind }
A PolicyKind contains the type metadata for a kind of policy.
type PolicyList ¶
type PolicyList interface { runtime.Object metav1.ListInterface }
A PolicyList is a Kubernetes object representing representing a list of policies.
type PredicateFn ¶
A PredicateFn returns true if the supplied object should be reconciled.
func HasClassReferenceKind ¶
func HasClassReferenceKind(k ClassKind) PredicateFn
HasClassReferenceKind accepts ResourceClaims that reference the correct kind of resourceclass
func NoClassReference ¶
func NoClassReference() PredicateFn
NoClassReference accepts ResourceClaims that do not reference a specific ResourceClass
func NoManagedResourceReference ¶
func NoManagedResourceReference() PredicateFn
NoManagedResourceReference accepts ResourceClaims that do not reference a specific Managed Resource
type PublisherChain ¶
type PublisherChain []ManagedConnectionPublisher
A PublisherChain chains multiple ManagedPublishers.
func (PublisherChain) PublishConnection ¶
func (pc PublisherChain) PublishConnection(ctx context.Context, mg Managed, c ConnectionDetails) error
PublishConnection calls each ManagedConnectionPublisher.PublishConnection serially. It returns the first error it encounters, if any.
func (PublisherChain) UnpublishConnection ¶
func (pc PublisherChain) UnpublishConnection(ctx context.Context, mg Managed, c ConnectionDetails) error
UnpublishConnection calls each ManagedConnectionPublisher.UnpublishConnection serially. It returns the first error it encounters, if any.
type Reclaimer ¶
type Reclaimer interface { SetReclaimPolicy(p v1alpha1.ReclaimPolicy) GetReclaimPolicy() v1alpha1.ReclaimPolicy }
A Reclaimer may specify a ReclaimPolicy.