Documentation ¶
Overview ¶
Package offered manages the lifecycle of claim controllers.
Index ¶
- func IsClaimCRD() resource.PredicateFn
- func NewClientApplicator(c client.Client) resource.ClientApplicator
- func OffersClaim() resource.PredicateFn
- func Setup(mgr ctrl.Manager, o apiextensionscontroller.Options) error
- type CRDRenderFn
- type CRDRenderer
- type ControllerEngine
- type EnqueueRequestForClaim
- func (e *EnqueueRequestForClaim) Create(_ context.Context, evt event.CreateEvent, q workqueue.RateLimitingInterface)
- func (e *EnqueueRequestForClaim) Delete(_ context.Context, evt event.DeleteEvent, q workqueue.RateLimitingInterface)
- func (e *EnqueueRequestForClaim) Generic(_ context.Context, evt event.GenericEvent, q workqueue.RateLimitingInterface)
- func (e *EnqueueRequestForClaim) Update(_ context.Context, evt event.UpdateEvent, q workqueue.RateLimitingInterface)
- type NopEngine
- func (e *NopEngine) GetClient() client.Client
- func (e *NopEngine) GetFieldIndexer() client.FieldIndexer
- func (e *NopEngine) IsRunning(_ string) bool
- func (e *NopEngine) Start(_ string, _ ...engine.ControllerOption) error
- func (e *NopEngine) StartWatches(_ string, _ ...engine.Watch) error
- func (e *NopEngine) Stop(_ context.Context, _ string) error
- type Reconciler
- type ReconcilerOption
- func WithCRDRenderer(c CRDRenderer) ReconcilerOption
- func WithControllerEngine(c ControllerEngine) ReconcilerOption
- func WithFinalizer(f resource.Finalizer) ReconcilerOption
- func WithLogger(log logging.Logger) ReconcilerOption
- func WithOptions(o apiextensionscontroller.Options) ReconcilerOption
- func WithRecorder(er event.Recorder) ReconcilerOption
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.
Types ¶
type CRDRenderFn ¶
type CRDRenderFn func(d *v1.CompositeResourceDefinition) (*extv1.CustomResourceDefinition, error)
A CRDRenderFn renders a CompositeResourceDefinition's corresponding CustomResourceDefinition.
func (CRDRenderFn) Render ¶
func (fn CRDRenderFn) Render(d *v1.CompositeResourceDefinition) (*extv1.CustomResourceDefinition, error)
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 ¶
func (e *EnqueueRequestForClaim) Create(_ context.Context, evt event.CreateEvent, q workqueue.RateLimitingInterface)
Create adds a NamespacedName for the supplied CreateEvent if its Object is a ClaimReferencer.
func (*EnqueueRequestForClaim) Delete ¶
func (e *EnqueueRequestForClaim) Delete(_ context.Context, evt event.DeleteEvent, q workqueue.RateLimitingInterface)
Delete adds a NamespacedName for the supplied DeleteEvent if its Object is a ClaimReferencer.
func (*EnqueueRequestForClaim) Generic ¶
func (e *EnqueueRequestForClaim) Generic(_ context.Context, evt event.GenericEvent, q workqueue.RateLimitingInterface)
Generic adds a NamespacedName for the supplied GenericEvent if its Object is a ClaimReferencer.
func (*EnqueueRequestForClaim) Update ¶
func (e *EnqueueRequestForClaim) Update(_ context.Context, evt event.UpdateEvent, q workqueue.RateLimitingInterface)
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) GetFieldIndexer ¶ added in v1.17.0
func (e *NopEngine) GetFieldIndexer() client.FieldIndexer
GetFieldIndexer returns a nil field indexer.
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
StartWatches 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.
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
func WithOptions(o apiextensionscontroller.Options) ReconcilerOption
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.