offered

package
v1.17.4 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Package offered manages the lifecycle of claim controllers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsClaimCRD added in v1.17.0

func IsClaimCRD() resource.PredicateFn

IsClaimCRD accepts any CustomResourceDefinition that represents a Claim.

func NewClientApplicator added in v1.17.0

func NewClientApplicator(c client.Client) resource.ClientApplicator

NewClientApplicator returns a ClientApplicator suitable for use by the offered controller.

func OffersClaim

func OffersClaim() resource.PredicateFn

OffersClaim accepts any CompositeResourceDefinition that offers a claim.

func Setup

Setup adds a controller that reconciles CompositeResourceDefinitions by defining a composite resource claim and starting a controller to reconcile it.

Types

type CRDRenderFn

A CRDRenderFn renders a CompositeResourceDefinition's corresponding CustomResourceDefinition.

func (CRDRenderFn) Render

Render the supplied CompositeResourceDefinition's corresponding CustomResourceDefinition.

type CRDRenderer

type CRDRenderer interface {
	Render(d *v1.CompositeResourceDefinition) (*extv1.CustomResourceDefinition, error)
}

A CRDRenderer renders a CompositeResourceDefinition's corresponding CustomResourceDefinition.

type ControllerEngine

type ControllerEngine interface {
	Start(name string, o ...engine.ControllerOption) error
	Stop(ctx context.Context, name string) error
	IsRunning(name string) bool
	StartWatches(name string, ws ...engine.Watch) error
	GetClient() client.Client
}

A ControllerEngine can start and stop Kubernetes controllers on demand.

type EnqueueRequestForClaim

type EnqueueRequestForClaim struct{}

EnqueueRequestForClaim enqueues a reconcile.Request for the NamespacedName of a ClaimReferencer's ClaimReference.

func (*EnqueueRequestForClaim) Create

Create adds a NamespacedName for the supplied CreateEvent if its Object is a ClaimReferencer.

func (*EnqueueRequestForClaim) Delete

Delete adds a NamespacedName for the supplied DeleteEvent if its Object is a ClaimReferencer.

func (*EnqueueRequestForClaim) Generic

Generic adds a NamespacedName for the supplied GenericEvent if its Object is a ClaimReferencer.

func (*EnqueueRequestForClaim) Update

Update adds a NamespacedName for the supplied UpdateEvent if its Objects are ClaimReferencers.

type NopEngine added in v1.17.0

type NopEngine struct{}

A NopEngine does nothing.

func (*NopEngine) GetClient added in v1.17.0

func (e *NopEngine) GetClient() client.Client

GetClient returns a nil client.

func (*NopEngine) GetFieldIndexer added in v1.17.0

func (e *NopEngine) GetFieldIndexer() client.FieldIndexer

GetFieldIndexer returns a nil field indexer.

func (*NopEngine) IsRunning added in v1.17.0

func (e *NopEngine) IsRunning(_ string) bool

IsRunning always returns true.

func (*NopEngine) Start added in v1.17.0

func (e *NopEngine) Start(_ string, _ ...engine.ControllerOption) error

Start does nothing.

func (*NopEngine) StartWatches added in v1.17.0

func (e *NopEngine) StartWatches(_ string, _ ...engine.Watch) error

StartWatches does nothing.

func (*NopEngine) Stop added in v1.17.0

func (e *NopEngine) Stop(_ context.Context, _ string) error

Stop does nothing.

type Reconciler

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

A Reconciler reconciles CompositeResourceDefinitions.

func NewReconciler

func NewReconciler(ca resource.ClientApplicator, opts ...ReconcilerOption) *Reconciler

NewReconciler returns a Reconciler of CompositeResourceDefinitions.

func (*Reconciler) Reconcile

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

Reconcile a CompositeResourceDefinition by defining a new kind of composite resource claim and starting a controller to reconcile it.

type ReconcilerOption

type ReconcilerOption func(*Reconciler)

ReconcilerOption is used to configure the Reconciler.

func WithCRDRenderer

func WithCRDRenderer(c CRDRenderer) ReconcilerOption

WithCRDRenderer specifies how the Reconciler should render a CompositeResourceDefinition's corresponding CustomResourceDefinition.

func WithControllerEngine

func WithControllerEngine(c ControllerEngine) ReconcilerOption

WithControllerEngine specifies how the Reconciler should manage the lifecycles of claim controllers.

func WithFinalizer

func WithFinalizer(f resource.Finalizer) ReconcilerOption

WithFinalizer specifies how the Reconciler should finalize CompositeResourceDefinitions.

func WithLogger

func WithLogger(log logging.Logger) ReconcilerOption

WithLogger specifies how the Reconciler should log messages.

func WithOptions added in v1.6.0

WithOptions lets the Reconciler know which options to pass to new composite resource claim controllers.

func WithRecorder

func WithRecorder(er event.Recorder) ReconcilerOption

WithRecorder specifies how the Reconciler should record Kubernetes events.

Jump to

Keyboard shortcuts

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