Documentation
¶
Overview ¶
Package claim provides a composite resource claim reconciler.
Index ¶
- Constants
- func Configure(_ context.Context, cm resource.CompositeClaim, cp resource.Composite) error
- func ControllerName(name string) string
- func Waiting() xpv1.Condition
- type APIBinder
- type APIConnectionPropagator
- type Binder
- type BinderFn
- type CompositeConfigurator
- type CompositeConfiguratorFn
- type ConnectionPropagator
- type ConnectionPropagatorFn
- type Reconciler
- type ReconcilerOption
- func WithBinder(b Binder) ReconcilerOption
- func WithClaimFinalizer(f resource.Finalizer) ReconcilerOption
- func WithClientApplicator(ca resource.ClientApplicator) ReconcilerOption
- func WithCompositeConfigurator(cf CompositeConfigurator) ReconcilerOption
- func WithConnectionPropagator(p ConnectionPropagator) ReconcilerOption
- func WithLogger(l logging.Logger) ReconcilerOption
- func WithRecorder(er event.Recorder) ReconcilerOption
Constants ¶
const ( LabelKeyNamePrefixForComposed = "crossplane.io/composite" LabelKeyClaimName = "crossplane.io/claim-name" LabelKeyClaimNamespace = "crossplane.io/claim-namespace" )
Label keys.
const (
ReasonWaiting = "Composite resource claim is waiting for composite resource to become Ready"
)
Reasons a composite resource claim is or is not ready.
Variables ¶
This section is empty.
Functions ¶
func Configure ¶
Configure the supplied composite resource. The composite resource name is derived from the supplied claim, as {name}-{random-string}. The claim's external name annotation, if any, is propagated to the composite resource.
func ControllerName ¶
ControllerName returns the recommended name for controllers that use this package to reconcile a particular kind of composite resource claim.
Types ¶
type APIBinder ¶
type APIBinder struct {
// contains filtered or unexported fields
}
An APIBinder binds claims to composites by updating them in a Kubernetes API server.
func NewAPIBinder ¶
func NewAPIBinder(c client.Client, t runtime.ObjectTyper) *APIBinder
NewAPIBinder returns a new APIBinder.
type APIConnectionPropagator ¶
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.
func NewAPIConnectionPropagator ¶
func NewAPIConnectionPropagator(c client.Client, t runtime.ObjectTyper) *APIConnectionPropagator
NewAPIConnectionPropagator returns a new APIConnectionPropagator.
func (*APIConnectionPropagator) PropagateConnection ¶
func (a *APIConnectionPropagator) PropagateConnection(ctx context.Context, to resource.LocalConnectionSecretOwner, from resource.ConnectionSecretOwner) (bool, error)
PropagateConnection details from the supplied resource.
type Binder ¶
type Binder interface {
// Bind the supplied Claim to the supplied Composite resource.
Bind(ctx context.Context, cm resource.CompositeClaim, cp resource.Composite) error
}
A Binder binds a composite resource claim to a composite resource.
type CompositeConfigurator ¶
type CompositeConfigurator interface {
Configure(ctx context.Context, cm resource.CompositeClaim, cp resource.Composite) error
}
A CompositeConfigurator configures the supplied composite resource, typically by converting it to a known type and populating its spec to reflect the supplied composite resource claim.
type CompositeConfiguratorFn ¶
type CompositeConfiguratorFn func(ctx context.Context, cm resource.CompositeClaim, cp resource.Composite) error
A CompositeConfiguratorFn configures the supplied composite resource, typically by converting it to a known type and populating its spec to reflect the supplied composite resource claim.
func (CompositeConfiguratorFn) Configure ¶
func (fn CompositeConfiguratorFn) Configure(ctx context.Context, cm resource.CompositeClaim, cp resource.Composite) error
Configure the supplied resource using the supplied claim.
type ConnectionPropagator ¶
type ConnectionPropagator interface {
PropagateConnection(ctx context.Context, to resource.LocalConnectionSecretOwner, from resource.ConnectionSecretOwner) (propagated bool, err error)
}
A ConnectionPropagator is responsible for propagating information required to connect to a resource.
type ConnectionPropagatorFn ¶
type ConnectionPropagatorFn func(ctx context.Context, to resource.LocalConnectionSecretOwner, from resource.ConnectionSecretOwner) (propagated bool, err error)
A ConnectionPropagatorFn is responsible for propagating information required to connect to a resource.
func (ConnectionPropagatorFn) PropagateConnection ¶
func (fn ConnectionPropagatorFn) PropagateConnection(ctx context.Context, to resource.LocalConnectionSecretOwner, from resource.ConnectionSecretOwner) (propagated bool, err error)
PropagateConnection details from one resource to the other.
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
A Reconciler reconciles composite resource claims by creating exactly one kind of concrete composite resource. Each composite resource claim kind should create an instance of this controller for each composite 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 composite resource claims and any composite resources they control.
func NewReconciler ¶
func NewReconciler(m manager.Manager, of resource.CompositeClaimKind, with resource.CompositeKind, o ...ReconcilerOption) *Reconciler
NewReconciler returns a Reconciler that reconciles composite resource claims of the supplied CompositeClaimKind with resources of the supplied CompositeKind. The returned Reconciler will apply only the ObjectMetaConfigurator by default; most callers should supply one or more CompositeConfigurators to configure their composite resources.
type ReconcilerOption ¶
type ReconcilerOption func(*Reconciler)
A ReconcilerOption configures a Reconciler.
func WithBinder ¶
func WithBinder(b Binder) ReconcilerOption
WithBinder specifies which Binder should be used to bind resources to their claim.
func WithClaimFinalizer ¶
func WithClaimFinalizer(f resource.Finalizer) ReconcilerOption
WithClaimFinalizer specifies which ClaimFinalizer should be used to finalize claims when they are deleted.
func WithClientApplicator ¶
func WithClientApplicator(ca resource.ClientApplicator) ReconcilerOption
WithClientApplicator specifies how the Reconciler should interact with the Kubernetes API.
func WithCompositeConfigurator ¶
func WithCompositeConfigurator(cf CompositeConfigurator) ReconcilerOption
WithCompositeConfigurator specifies how the Reconciler should configure the bound composite resource.
func WithConnectionPropagator ¶
func WithConnectionPropagator(p ConnectionPropagator) ReconcilerOption
WithConnectionPropagator specifies which ConnectionPropagator should be used to propagate resource connection details to their claim.
func WithLogger ¶
func WithLogger(l logging.Logger) ReconcilerOption
WithLogger specifies how the Reconciler should log messages.
func WithRecorder ¶
func WithRecorder(er event.Recorder) ReconcilerOption
WithRecorder specifies how the Reconciler should record events.