Skip to content

Commit

Permalink
📖 Clarify that the reconcile.Result is ignored on non-nil error
Browse files Browse the repository at this point in the history
It isn't obvious for people new to the project that the returned error
is part of the control flow and that if it is set, the Result will be
ignored. Add some godocs to clarify that.
  • Loading branch information
alvaroaleman committed Aug 14, 2023
1 parent 964a416 commit 06fb2e9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pkg/reconcile/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,16 @@ instead the reconcile function observes this when reading the cluster state and
*/
type Reconciler interface {
// Reconcile performs a full reconciliation for the object referred to by the Request.
// The Controller will requeue the Request to be processed again if an error is non-nil or
// Result.Requeue is true, otherwise upon completion it will remove the work from the queue.
//
// If the returned error is non-nil, the Result is ignored and the request will be
// requeued using exponential backoff. The only exception is if the error is a
// TerminalError in which case no requeuing happens.
//
// If the error is nil and the returned Result has a non-zero result.RequeueAfter, the request
// will be requeued after the specified duration.
//
// If the error is nil and result.RequeueAfter is zero and result.Reque is true, the request
// will be requeued using exponential backoff.
Reconcile(context.Context, Request) (Result, error)
}

Expand Down

0 comments on commit 06fb2e9

Please sign in to comment.