controller

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 client.Object, logger logr.Logger) reconcile.Reconciler

NewReconciler creates a new generic Reconciler.

Types

type Actuator

type Actuator interface {
	// CreateOrUpdate reconciles object creation or update.
	CreateOrUpdate(context.Context, client.Object) (time.Duration, error)
	// Delete reconciles object deletion.
	Delete(context.Context, client.Object) error
	// ShouldFinalize returns true if the object should be finalized.
	ShouldFinalize(context.Context, client.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 client.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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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