Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeReconcileResult ¶
func ComputeReconcileResult(obj conditions.Setter, res Result, recErr error, rb RuntimeResultBuilder) ([]patch.Option, ctrl.Result, error)
ComputeReconcileResult analyzes the reconcile results (result + error), updates the status conditions of the object with any corrections and returns object patch configuration, runtime result and runtime error. The caller is responsible for using the patch configuration while patching the object in the API server. The RuntimeResultBuilder is used to define how the ctrl.Result is computed.
Types ¶
type AlwaysRequeueResultBuilder ¶
type AlwaysRequeueResultBuilder struct { // RequeueAfter is the fixed period at which the reconciler requeues on // successful execution. RequeueAfter time.Duration }
AlwaysRequeueResultBuilder implements a RuntimeResultBuilder for always requeuing reconcilers. A successful reconciliation result for such reconcilers contains a fixed RequeueAfter value.
func (AlwaysRequeueResultBuilder) BuildRuntimeResult ¶
func (r AlwaysRequeueResultBuilder) BuildRuntimeResult(rr Result, err error) ctrl.Result
BuildRuntimeResult converts a given Result and error into the return values of a controller's Reconcile function.
type Result ¶
type Result int
Result is a type for creating an abstraction for the controller-runtime reconcile Result to simplify the Result values.
const ( // ResultEmpty indicates a reconcile result which does not requeue. It is // also used when returning an error, since the error overshadows result. ResultEmpty Result = iota // ResultRequeue indicates a reconcile result which should immediately // requeue. ResultRequeue // ResultSuccess indicates a reconcile success result. // For a reconciler that requeues regularly at a fixed interval, runtime // result with a fixed RequeueAfter is success result. // For a reconciler that doesn't requeue on successful reconciliation, // an empty runtime result is success result. // It is usually returned at the end of a reconciler/sub-reconciler. ResultSuccess )
func LowestRequeuingResult ¶
LowestRequeuingResult returns the ReconcileResult with the lowest requeue period. Weightage:
ResultRequeue - immediate requeue (lowest) ResultSuccess - requeue at an interval ResultEmpty - no requeue