Documentation ¶
Index ¶
- func ReconcileHandler(operations []Operation) (ctrl.Result, error)
- func SetupControllers(mgr manager.Manager, cluster cluster.Cluster, controllers ...Controller) error
- type CacheInitializer
- type Controller
- type Operation
- type OperationResult
- func ContinueProcessing() (OperationResult, error)
- func Requeue() (OperationResult, error)
- func RequeueAfter(delay time.Duration, err error) (OperationResult, error)
- func RequeueOnErrorOrContinue(err error) (OperationResult, error)
- func RequeueOnErrorOrStop(err error) (OperationResult, error)
- func RequeueWithError(err error) (OperationResult, error)
- func StopProcessing() (OperationResult, error)
- type ValidationFunction
- type ValidationResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReconcileHandler ¶
ReconcileHandler will invoke all the operations to be performed as part of an object reconcile, managing the queue based on the operations' results.
func SetupControllers ¶
func SetupControllers(mgr manager.Manager, cluster cluster.Cluster, controllers ...Controller) error
SetupControllers invoke the Register function of every controller passed as an argument to this function. If a given Controller implements CacheInitializer, the cache will be initialized before registering the controller.
Types ¶
type CacheInitializer ¶
CacheInitializer is an interface that should be implemented by operator controllers requiring to index fields.
type Controller ¶
type Controller interface { reconcile.Reconciler Register(mgr ctrl.Manager, log *logr.Logger, cluster cluster.Cluster) error }
Controller is an interface that should be implemented by operator controllers and that allows to have a cohesive way of defining them and register them.
type Operation ¶
type Operation func() (OperationResult, error)
Operation defines the syntax of functions invoked by the ReconcileHandler
type OperationResult ¶
OperationResult represents the result of a reconcile operation
func ContinueProcessing ¶
func ContinueProcessing() (OperationResult, error)
ContinueProcessing returns an (OperationResult, error) tuple instructing the reconcile loop to continue reconciling of the object.
func Requeue ¶
func Requeue() (OperationResult, error)
Requeue returns an (OperationResult, error) tuple instructing the reconcile loop to requeue the object.
func RequeueAfter ¶
func RequeueAfter(delay time.Duration, err error) (OperationResult, error)
RequeueAfter returns an (OperationResult, error) tuple instructing the reconcile loop to requeue the object after the given delay.
func RequeueOnErrorOrContinue ¶
func RequeueOnErrorOrContinue(err error) (OperationResult, error)
RequeueOnErrorOrContinue returns an (OperationResult, error) tuple instructing the reconcile loop to requeue the object in case of an error or to continue reconciling the object.
func RequeueOnErrorOrStop ¶
func RequeueOnErrorOrStop(err error) (OperationResult, error)
RequeueOnErrorOrStop returns an (OperationResult, error) tuple instructing the reconcile loop to requeue the object in case of an error or to stop reconciling the object.
func RequeueWithError ¶
func RequeueWithError(err error) (OperationResult, error)
RequeueWithError returns an (OperationResult, error) tuple instructing the reconcile loop to requeue the object with the given reconcile error.
func StopProcessing ¶
func StopProcessing() (OperationResult, error)
StopProcessing returns an (OperationResult, error) tuple instructing the reconcile loop to stop reconciling the object.
type ValidationFunction ¶
type ValidationFunction func() *ValidationResult
ValidationFunction defines the signature of validation functions that this validator can invoke.
type ValidationResult ¶
ValidationResult is a struct containing whether a validation passed and what was the error in case that it didn't pass.
func Validate ¶
func Validate(functions ...ValidationFunction) *ValidationResult
Validate evaluates all the validation functions passed as an argument and returns a ValidationResult indicating whether the validation passed or not. In case of one of the functions failing the validation, the process will be interrupted and the error will be returned immediately.