Documentation ¶
Overview ¶
Package claim implements composite resource claims.
Index ¶
- func ControllerName(name string) string
- func Waiting() xpv1.Condition
- type APIBinder
- type APIClaimConfigurator
- type APIConnectionPropagator
- type APIDefaultSelector
- type APIDryRunCompositeConfigurator
- type Binder
- type BinderFn
- type Configurator
- type ConfiguratorFn
- type ConnectionPropagator
- type ConnectionPropagatorChain
- type ConnectionPropagatorFn
- type ConnectionUnpublisher
- type ConnectionUnpublisherFn
- type DefaultsSelector
- type DefaultsSelectorFn
- type NopConnectionUnpublisher
- 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 WithConnectionUnpublisher(u ConnectionUnpublisher) ReconcilerOption
- func WithDefaultsSelector(d DefaultsSelector) ReconcilerOption
- func WithLogger(l logging.Logger) ReconcilerOption
- func WithPollInterval(after time.Duration) ReconcilerOption
- func WithRecorder(er event.Recorder) ReconcilerOption
- type SecretStoreConnectionUnpublisher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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, cm 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) *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 APIDefaultSelector ¶ added in v1.12.0
type APIDefaultSelector struct {
// contains filtered or unexported fields
}
APIDefaultSelector selects the default composite delete policy referenced in the definition of the resource if the policy is not specified in the claim.
func NewAPIDefaultSelector ¶ added in v1.12.0
func NewAPIDefaultSelector(c client.Client, ref corev1.ObjectReference, r event.Recorder) *APIDefaultSelector
NewAPIDefaultSelector returns a APIDefaultSelector.
func (*APIDefaultSelector) SelectDefaults ¶ added in v1.12.0
func (s *APIDefaultSelector) SelectDefaults(ctx context.Context, cm resource.CompositeClaim) error
SelectDefaults selects the default composite delete policy if a policy is not given in the Claim.
type APIDryRunCompositeConfigurator ¶ added in v1.2.4
type APIDryRunCompositeConfigurator struct {
// contains filtered or unexported fields
}
An APIDryRunCompositeConfigurator configures composite resources. It may perform a dry-run create against an API server in order to name and validate the configured resource.
func NewAPIDryRunCompositeConfigurator ¶ added in v1.2.4
func NewAPIDryRunCompositeConfigurator(c client.Client) *APIDryRunCompositeConfigurator
NewAPIDryRunCompositeConfigurator returns a Configurator of composite resources that may perform a dry-run create against an API server in order to name and validate the configured resource.
func (*APIDryRunCompositeConfigurator) Configure ¶ added in v1.2.4
func (c *APIDryRunCompositeConfigurator) Configure(ctx context.Context, cm resource.CompositeClaim, cp resource.Composite) error
Configure the supplied composite resource by propagating configuration from the supplied claim. Both create and update scenarios are supported; i.e. the composite may or may not have been created in the API server when passed to this method. The configured composite may be submitted to an API server via a dry run create in order to name and validate it.
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 ConnectionPropagatorChain ¶ added in v1.7.0
type ConnectionPropagatorChain []ConnectionPropagator
A ConnectionPropagatorChain runs multiple connection propagators.
func (ConnectionPropagatorChain) PropagateConnection ¶ added in v1.7.0
func (pc ConnectionPropagatorChain) PropagateConnection(ctx context.Context, to resource.LocalConnectionSecretOwner, from resource.ConnectionSecretOwner) (propagated bool, err error)
PropagateConnection details from one resource to the other. This method calls PropagateConnection for all ConnectionPropagator's in the chain and returns propagated if at least one ConnectionPropagator propagates the connection details but exits with an error if any of them fails without calling the remaining ones.
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 ConnectionUnpublisher ¶ added in v1.7.0
type ConnectionUnpublisher interface { // UnpublishConnection details for the supplied Managed resource. UnpublishConnection(ctx context.Context, so resource.LocalConnectionSecretOwner, c managed.ConnectionDetails) error }
A ConnectionUnpublisher is responsible for cleaning up connection secret.
type ConnectionUnpublisherFn ¶ added in v1.7.0
type ConnectionUnpublisherFn func(ctx context.Context, so resource.LocalConnectionSecretOwner, c managed.ConnectionDetails) error
A ConnectionUnpublisherFn is responsible for cleaning up connection secret.
func (ConnectionUnpublisherFn) UnpublishConnection ¶ added in v1.7.0
func (fn ConnectionUnpublisherFn) UnpublishConnection(ctx context.Context, so resource.LocalConnectionSecretOwner, c managed.ConnectionDetails) error
UnpublishConnection details of a local connection secret owner.
type DefaultsSelector ¶ added in v1.12.0
type DefaultsSelector interface { // SelectDefaults from CompositeResourceDefinition when needed. SelectDefaults(ctx context.Context, cm resource.CompositeClaim) error }
A DefaultsSelector copies default values from the CompositeResourceDefinition when the corresponding field in the Claim is not set.
type DefaultsSelectorFn ¶ added in v1.12.0
type DefaultsSelectorFn func(ctx context.Context, cm resource.CompositeClaim) error
A DefaultsSelectorFn is responsible for copying default values from the CompositeResourceDefinition
func (DefaultsSelectorFn) SelectDefaults ¶ added in v1.12.0
func (fn DefaultsSelectorFn) SelectDefaults(ctx context.Context, cm resource.CompositeClaim) error
SelectDefaults copies default values from the XRD if necessary
type NopConnectionUnpublisher ¶ added in v1.7.0
type NopConnectionUnpublisher struct{}
NopConnectionUnpublisher is a ConnectionUnpublisher that does nothing.
func NewNopConnectionUnpublisher ¶ added in v1.7.0
func NewNopConnectionUnpublisher() *NopConnectionUnpublisher
NewNopConnectionUnpublisher returns a new NopConnectionUnpublisher
func (*NopConnectionUnpublisher) UnpublishConnection ¶ added in v1.7.0
func (n *NopConnectionUnpublisher) UnpublishConnection(_ context.Context, _ resource.LocalConnectionSecretOwner, _ managed.ConnectionDetails) error
UnpublishConnection does nothing and returns no error with UnpublishConnection. Expected to be used where deletion of connection secret is already handled by K8s garbage collection and there is actually nothing to do to unpublish connection details.
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 WithConnectionUnpublisher ¶ added in v1.7.0
func WithConnectionUnpublisher(u ConnectionUnpublisher) ReconcilerOption
WithConnectionUnpublisher specifies which ConnectionUnpublisher should be used to unpublish resource connection details.
func WithDefaultsSelector ¶ added in v1.12.0
func WithDefaultsSelector(d DefaultsSelector) ReconcilerOption
WithDefaultsSelector specifies which DefaultsSelector should be used to copy defaults from the CompositeResourceDefinition to the claim
func WithLogger ¶
func WithLogger(l logging.Logger) ReconcilerOption
WithLogger specifies how the Reconciler should log messages.
func WithPollInterval ¶ added in v1.11.1
func WithPollInterval(after time.Duration) ReconcilerOption
WithPollInterval specifies how long the Reconciler should wait before queueing a new reconciliation after a successful reconcile. The Reconciler requeues after a specified duration when it is not actively waiting for an external operation, but wishes to check whether resources it does not have a watch on (i.e. composed resources) need to be reconciled.
func WithRecorder ¶
func WithRecorder(er event.Recorder) ReconcilerOption
WithRecorder specifies how the Reconciler should record events.
type SecretStoreConnectionUnpublisher ¶ added in v1.7.0
type SecretStoreConnectionUnpublisher struct {
// contains filtered or unexported fields
}
SecretStoreConnectionUnpublisher unpublishes secret store connection secrets.
func NewSecretStoreConnectionUnpublisher ¶ added in v1.7.0
func NewSecretStoreConnectionUnpublisher(p managed.ConnectionPublisher) *SecretStoreConnectionUnpublisher
NewSecretStoreConnectionUnpublisher returns a new SecretStoreConnectionUnpublisher.
func (*SecretStoreConnectionUnpublisher) UnpublishConnection ¶ added in v1.7.0
func (u *SecretStoreConnectionUnpublisher) UnpublishConnection(ctx context.Context, so resource.LocalConnectionSecretOwner, c managed.ConnectionDetails) error
UnpublishConnection details for the supplied Managed resource.