Documentation ¶
Overview ¶
Package definition manages the lifecycle of XR controllers.
Index ¶
- func CompositeReconcilerOptions(co controller.Options, d *v1.CompositeResourceDefinition, c client.Client, ...) []composite.ReconcilerOption
- func Setup(mgr ctrl.Manager, o controller.Options) error
- type CRDRenderFn
- type CRDRenderer
- type ControllerEngine
- type Reconciler
- type ReconcilerOption
- func WithCRDRenderer(c CRDRenderer) ReconcilerOption
- func WithClientApplicator(ca resource.ClientApplicator) ReconcilerOption
- func WithControllerEngine(c ControllerEngine) ReconcilerOption
- func WithFinalizer(f resource.Finalizer) ReconcilerOption
- func WithLogger(log logging.Logger) ReconcilerOption
- func WithOptions(o controller.Options) ReconcilerOption
- func WithRecorder(er event.Recorder) ReconcilerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompositeReconcilerOptions ¶ added in v1.11.0
func CompositeReconcilerOptions(co controller.Options, d *v1.CompositeResourceDefinition, c client.Client, l logging.Logger, e event.Recorder) []composite.ReconcilerOption
CompositeReconcilerOptions builds the options for a composite resource reconciler. The options vary based on the supplied feature flags.
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 { IsRunning(name string) bool Start(name string, o kcontroller.Options, w ...controller.Watch) error Stop(name string) Err(name string) error }
A ControllerEngine can start and stop Kubernetes controllers on demand.
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
A Reconciler reconciles CompositeResourceDefinitions.
func NewReconciler ¶
func NewReconciler(mgr manager.Manager, 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 an CompositeResourceDefinition's corresponding CustomResourceDefinition.
func WithClientApplicator ¶
func WithClientApplicator(ca resource.ClientApplicator) ReconcilerOption
WithClientApplicator specifies how the Reconciler should interact with the Kubernetes API.
func WithControllerEngine ¶
func WithControllerEngine(c ControllerEngine) ReconcilerOption
WithControllerEngine specifies how the Reconciler should manage the lifecycles of composite 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 controller.Options) ReconcilerOption
WithOptions lets the Reconciler know which options to pass to new composite resource controllers.
func WithRecorder ¶
func WithRecorder(er event.Recorder) ReconcilerOption
WithRecorder specifies how the Reconciler should record Kubernetes events.