claim

package
v0.14.0-rc Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: Apache-2.0 Imports: 23 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 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

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() v1alpha1.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. 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.

func (*APIBinder) Bind

Bind the supplied claim to the supplied composite.

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

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

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.

func (BinderFns) Bind

Bind the supplied Claim to the supplied Composite resource.

func (BinderFns) Unbind

Unbind the supplied Claim from the supplied Composite resource.

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

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

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

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

Jump to

Keyboard shortcuts

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