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() v1alpha1.Condition
- type APIBinder
- type APICompositeCreator
- type APICompositeDeleter
- type Binder
- type BinderFns
- type CompositeConfigurator
- type CompositeConfiguratorFn
- type CompositeCreator
- type CompositeCreatorFn
- type CompositeDeleter
- type Reconciler
- type ReconcilerOption
- func WithBinder(b Binder) ReconcilerOption
- func WithClaimFinalizer(f resource.Finalizer) ReconcilerOption
- func WithCompositeCreator(c CompositeCreator) ReconcilerOption
- func WithConnectionPropagator(p resource.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 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. Note that APIBinder does not support objects that do not use the status subresource; such objects should use APIBinder.
func NewAPIBinder ¶
func NewAPIBinder(c client.Client, t runtime.ObjectTyper) *APIBinder
NewAPIBinder returns a new APIBinder.
type APICompositeCreator ¶
type APICompositeCreator struct {
// contains filtered or unexported fields
}
An APICompositeCreator creates resources by submitting them to a Kubernetes API server.
func NewAPICompositeCreator ¶
func NewAPICompositeCreator(c client.Client, t runtime.ObjectTyper) *APICompositeCreator
NewAPICompositeCreator returns a new APICompositeCreator.
func (*APICompositeCreator) Create ¶
func (a *APICompositeCreator) Create(ctx context.Context, cm resource.CompositeClaim, cp resource.Composite) error
Create the supplied composite using the supplied claim.
type APICompositeDeleter ¶
type APICompositeDeleter struct {
// contains filtered or unexported fields
}
An APICompositeDeleter deletes composite resources from the API server.
func NewAPICompositeDeleter ¶
func NewAPICompositeDeleter(c client.Client) *APICompositeDeleter
NewAPICompositeDeleter returns a new APICompositeDeleter.
func (*APICompositeDeleter) Delete ¶
func (a *APICompositeDeleter) Delete(ctx context.Context, _ resource.CompositeClaim, cp resource.Composite) error
Delete the supplied composite resource from the API server.
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 BinderFns ¶
type BinderFns struct { BindFn func(ctx context.Context, cm resource.CompositeClaim, cp resource.Composite) error UnbindFn func(ctx context.Context, cm resource.CompositeClaim, cp resource.Composite) error }
BinderFns satisfy the Binder interface.
type CompositeConfigurator ¶
type CompositeConfigurator interface {
Configure(ctx context.Context, cm resource.CompositeClaim, cp resource.Composite) error
}
A CompositeConfigurator configures a resource, typically by converting it to a known type and populating its spec.
type CompositeConfiguratorFn ¶
type CompositeConfiguratorFn func(ctx context.Context, cm resource.CompositeClaim, cp resource.Composite) error
A CompositeConfiguratorFn is a function that satisfies the CompositeConfigurator interface.
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 CompositeCreator ¶
type CompositeCreator interface {
Create(ctx context.Context, cm resource.CompositeClaim, cp resource.Composite) error
}
A CompositeCreator creates a resource, typically by submitting it to an API server. CompositeCreators must not modify the supplied resource class, but are responsible for final modifications to the claim and resource, for example ensuring resource, claim, and owner references are set.
type CompositeCreatorFn ¶
type CompositeCreatorFn func(ctx context.Context, cm resource.CompositeClaim, cp resource.Composite) error
A CompositeCreatorFn is a function that satisfies the CompositeCreator interface.
func (CompositeCreatorFn) Create ¶
func (fn CompositeCreatorFn) Create(ctx context.Context, cm resource.CompositeClaim, cp resource.Composite) error
Create the supplied resource.
type CompositeDeleter ¶
type CompositeDeleter interface { // Delete the supplied Claim to the supplied Composite resource. Delete(ctx context.Context, cm resource.CompositeClaim, cp resource.Composite) error }
A CompositeDeleter deletes a composite resource.
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 WithCompositeCreator ¶
func WithCompositeCreator(c CompositeCreator) ReconcilerOption
WithCompositeCreator specifies which CompositeCreator should be used to create composite resources.
func WithConnectionPropagator ¶
func WithConnectionPropagator(p resource.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.