claim

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package claim provides a composite resource claim reconciler.

Index

Constants

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

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

Jump to

Keyboard shortcuts

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