controller

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Phase

type Phase func(ctx context.Context, log logr.Logger, clusterSpec *cluster.Spec) (Result, error)

Phase represents a generic reconciliation phase for a cluster spec

type PhaseRunner

type PhaseRunner struct {
	// contains filtered or unexported fields
}

PhaseRunner allows to execute Phases in order

func NewPhaseRunner

func NewPhaseRunner() PhaseRunner

NewPhaseRunner creates a new PhaseRunner without any Phases

func (PhaseRunner) Register

func (r PhaseRunner) Register(phases ...Phase) PhaseRunner

Register adds a phase to the runnner

func (PhaseRunner) Run

func (r PhaseRunner) Run(ctx context.Context, log logr.Logger, clusterSpec *cluster.Spec) (Result, error)

Run will execute phases in the order they were registered until a phase returns an error or a Result that requests to an interruption

type Result

type Result struct {
	Result *ctrl.Result
}

Result represents the result of a reconciliation It allows to express intent for a reconciliation interruption without necessarily requeueing the request

func ResultWithRequeue

func ResultWithRequeue(after time.Duration) Result

ResultWithReturn creates a new Result that requeues the request after the provided duration

func ResultWithReturn

func ResultWithReturn() Result

ResultWithReturn creates a new Result that interrupts the reconciliation without requeueing

func (*Result) Return

func (r *Result) Return() bool

Return evaluates the intent of a Result to interrupt the reconciliation process or not

func (Result) ToCtrlResult

func (r Result) ToCtrlResult() ctrl.Result

ToCtrlResult converts Result to a controller-runtime result

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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