claim

package
v1.15.2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package claim implements composite resource claims.

Index

Constants

View Source
const (
	// FieldOwnerXR owns the fields this controller mutates on composite
	// resources (XRs).
	FieldOwnerXR = "apiextensions.crossplane.io/claim"
)

Server-side-apply field owners.

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 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 ClientSideCompositeSyncer added in v1.15.0

type ClientSideCompositeSyncer struct {
	// contains filtered or unexported fields
}

A ClientSideCompositeSyncer binds and syncs a claim with a composite resource (XR). It uses client-side apply to update the claim and the composite.

func NewClientSideCompositeSyncer added in v1.15.0

func NewClientSideCompositeSyncer(c client.Client, ng names.NameGenerator) *ClientSideCompositeSyncer

NewClientSideCompositeSyncer returns a CompositeSyncer that uses client-side apply to sync a claim with a composite resource.

func (*ClientSideCompositeSyncer) Sync added in v1.15.0

Sync the supplied claim with the supplied composite resource (XR). Syncing may involve creating and binding the XR.

type CompositeSyncer added in v1.15.0

type CompositeSyncer interface {
	Sync(ctx context.Context, cm *claim.Unstructured, xr *composite.Unstructured) error
}

A CompositeSyncer binds and syncs the supplied claim with the supplied composite resource (XR).

type CompositeSyncerFn added in v1.15.0

type CompositeSyncerFn func(ctx context.Context, cm *claim.Unstructured, xr *composite.Unstructured) error

A CompositeSyncerFn binds and syncs the supplied claim with the supplied composite resource (XR).

func (CompositeSyncerFn) Sync added in v1.15.0

Sync the supplied claim with the supplied composite resource..

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 ManagedFieldsUpgrader added in v1.15.0

type ManagedFieldsUpgrader interface {
	Upgrade(ctx context.Context, obj client.Object, ssaManager string, csaManagers ...string) error
}

A ManagedFieldsUpgrader upgrades an objects managed fields from client-side apply to server-side apply. This is necessary when an object was previously managed using client-side apply, but should now be managed using server-side apply. See https://github.com/kubernetes/kubernetes/issues/99003 for details.

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 NopManagedFieldsUpgrader added in v1.15.0

type NopManagedFieldsUpgrader struct{}

A NopManagedFieldsUpgrader does nothing.

func (*NopManagedFieldsUpgrader) Upgrade added in v1.15.0

Upgrade does nothing.

type PatchingManagedFieldsUpgrader added in v1.15.0

type PatchingManagedFieldsUpgrader struct {
	// contains filtered or unexported fields
}

A PatchingManagedFieldsUpgrader uses a JSON patch to upgrade an object's managed fields from client-side to server-side apply. The upgrade is a no-op if the object does not need upgrading.

func NewPatchingManagedFieldsUpgrader added in v1.15.0

func NewPatchingManagedFieldsUpgrader(w client.Writer) *PatchingManagedFieldsUpgrader

NewPatchingManagedFieldsUpgrader returns a ManagedFieldsUpgrader that uses a JSON patch to upgrade and object's managed fields from client-side to server-side apply.

func (*PatchingManagedFieldsUpgrader) Upgrade added in v1.15.0

func (u *PatchingManagedFieldsUpgrader) Upgrade(ctx context.Context, obj client.Object, ssaManager string, csaManagers ...string) error

Upgrade the supplied object's field managers from client-side to server-side apply.

type Reconciler

type Reconciler struct {
	// contains filtered or unexported fields
}

A Reconciler reconciles claims by creating exactly one kind of composite resource (XR). Each claim kind should create an instance of this controller for each XR kind they can bind to. Each controller must watch its subset of claims and any XRs they bind to.

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 WithClaimFinalizer

func WithClaimFinalizer(f resource.Finalizer) ReconcilerOption

WithClaimFinalizer specifies which ClaimFinalizer should be used to finalize claims when they are deleted.

func WithClient added in v1.15.0

func WithClient(c client.Client) ReconcilerOption

WithClient specifies how the Reconciler should interact with the Kubernetes API.

func WithCompositeSyncer added in v1.15.0

func WithCompositeSyncer(cs CompositeSyncer) ReconcilerOption

WithCompositeSyncer specifies how the Reconciler should sync claims with composite resources (XRs).

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 WithManagedFieldsUpgrader added in v1.15.0

func WithManagedFieldsUpgrader(u ManagedFieldsUpgrader) ReconcilerOption

WithManagedFieldsUpgrader specifies how the Reconciler should upgrade claim and composite resource (XR) managed fields from client-side apply to server-side apply.

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.

type ServerSideCompositeSyncer added in v1.15.0

type ServerSideCompositeSyncer struct {
	// contains filtered or unexported fields
}

A ServerSideCompositeSyncer binds and syncs a claim with a composite resource (XR). It uses server-side apply to update the XR.

func NewServerSideCompositeSyncer added in v1.15.0

func NewServerSideCompositeSyncer(c client.Client, ng names.NameGenerator) *ServerSideCompositeSyncer

NewServerSideCompositeSyncer returns a CompositeSyncer that uses server-side apply to sync a claim with a composite resource.

func (*ServerSideCompositeSyncer) Sync added in v1.15.0

Sync the supplied claim with the supplied composite resource (XR). Syncing may involve creating and binding the XR.

Jump to

Keyboard shortcuts

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