claim

package
v1.14.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package claim implements composite resource claims.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ControllerName

func ControllerName(name string) string

ControllerName returns the recommended name for controllers that use this package to reconcile a particular kind of composite resource claim.

func Waiting

func Waiting() xpv1.Condition

Waiting returns a condition that indicates the composite resource claim is currently waiting for its composite resource to become ready.

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) *APIBinder

NewAPIBinder returns a new APIBinder.

func (*APIBinder) Bind

Bind the supplied claim to the supplied composite.

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

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

PropagateConnection details from the supplied resource.

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

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 BinderFn

type BinderFn func(ctx context.Context, cm resource.CompositeClaim, cp resource.Composite) error

A BinderFn binds a composite resource claim to a composite resource.

func (BinderFn) Bind

Bind the supplied Claim to the supplied 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

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

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

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

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

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.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error)

Reconcile a composite resource claim with a concrete composite resource.

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 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

UnpublishConnection details for the supplied Managed resource.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL