Documentation ¶
Overview ¶
Package claim provides a composite resource claim reconciler.
Index ¶
- Constants
- func ConfigureComposite(_ context.Context, cm resource.CompositeClaim, cp resource.Composite) error
- func ControllerName(name string) string
- func Waiting() xpv1.Condition
- type APIBinder
- type APIClaimConfigurator
- type APIConnectionPropagator
- type Binder
- type BinderFn
- type Configurator
- type ConfiguratorFn
- type ConnectionPropagator
- type ConnectionPropagatorFn
- type Reconciler
- type ReconcilerOption
- func WithBinder(b Binder) ReconcilerOption
- func WithClaimConfigurator(cf Configurator) ReconcilerOption
- func WithClaimFinalizer(f resource.Finalizer) ReconcilerOption
- func WithClientApplicator(ca resource.ClientApplicator) ReconcilerOption
- func WithCompositeConfigurator(cf Configurator) ReconcilerOption
- func WithConnectionPropagator(p ConnectionPropagator) ReconcilerOption
- func WithLogger(l logging.Logger) ReconcilerOption
- func WithRecorder(er event.Recorder) ReconcilerOption
Constants ¶
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 ConfigureComposite ¶ added in v1.1.0
ConfigureComposite configures 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 APIClaimConfigurator ¶ added in v1.1.0
type APIClaimConfigurator struct {
// contains filtered or unexported fields
}
APIClaimConfigurator configures the supplied claims with fields from the composite. This includes late-initializing spec values and updating status fields in claim.
func NewAPIClaimConfigurator ¶ added in v1.1.0
func NewAPIClaimConfigurator(client client.Client) *APIClaimConfigurator
NewAPIClaimConfigurator returns a APIClaimConfigurator.
func (*APIClaimConfigurator) Configure ¶ added in v1.1.0
func (c *APIClaimConfigurator) Configure(ctx context.Context, cr resource.CompositeClaim, cp resource.Composite) error
Configure the supplied claims with fields from the composite. This includes late-initializing spec values and updating status fields in claim.
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 Configurator ¶ added in v1.1.0
type Configurator interface {
Configure(ctx context.Context, cm resource.CompositeClaim, cp resource.Composite) error
}
A Configurator configures the supplied resource, typically either populating the composite with fields from the claim, or claim with fields from composite.
type ConfiguratorFn ¶ added in v1.1.0
type ConfiguratorFn func(ctx context.Context, cm resource.CompositeClaim, cp resource.Composite) error
A ConfiguratorFn configures the supplied resource, typically either populating the composite with fields from the claim, or claim with fields from composite.
func (ConfiguratorFn) Configure ¶ added in v1.1.0
func (fn ConfiguratorFn) 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 WithClaimConfigurator ¶ added in v1.1.0
func WithClaimConfigurator(cf Configurator) ReconcilerOption
WithClaimConfigurator specifies how the Reconciler should configure the bound claim resource.
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 Configurator) 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.