This section is empty.


This section is empty.


func Add

func Add(mgr manager.Manager, args AddArgs) error

Add creates a new controller and adds it to the given manager using the given args.

func DefaultPredicates

func DefaultPredicates() []predicate.Predicate

DefaultPredicates returns the default predicates for a reconciler.

func NewReconciler

func NewReconciler(mgr manager.Manager, actuator Actuator, controllerName, finalizerName string, typ runtime.Object, logger logr.Logger) reconcile.Reconciler

NewReconciler creates a new generic Reconciler.


type Actuator

type Actuator interface {
	// CreateOrUpdate reconciles object creation or update.
	CreateOrUpdate(context.Context, runtime.Object) (time.Duration, error)
	// Delete reconciles object deletion.
	Delete(context.Context, runtime.Object) error
	// ShouldFinalize returns true if the object should be finalized.
	ShouldFinalize(context.Context, runtime.Object) (bool, error)

Actuator acts upon objects being reconciled by a Reconciler.

type AddArgs

type AddArgs struct {
	// Actuator is an actuator.
	Actuator Actuator
	// ControllerName is the name of the controller.
	ControllerName string
	// FinalizerName is the finalizer name.
	FinalizerName string
	// ControllerOptions are the controller options to use when creating a controller.
	// The Reconciler field is always overridden with a reconciler created from the given actuator.
	ControllerOptions controller.Options
	// Type is the object type to watch.
	Type runtime.Object
	// Predicates are the predicates to use when watching objects.
	Predicates []predicate.Predicate
	// WatchBuilder defines additional watches that should be set up.
	WatchBuilder extensionscontroller.WatchBuilder

AddArgs are arguments for adding a controller to a manager.


Path Synopsis