Skip to content

Commit e451c79

Browse files
authored
Merge pull request #3107 from alvaroaleman/deprecate
⚠️ Deprecate `reconcile.Result.Requeue`
2 parents d9e02f9 + f15ff17 commit e451c79

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

pkg/internal/controller/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ func (c *Controller[request]) reconcileHandler(ctx context.Context, req request)
348348
c.Queue.Forget(req)
349349
c.Queue.AddAfter(req, result.RequeueAfter)
350350
ctrlmetrics.ReconcileTotal.WithLabelValues(c.Name, labelRequeueAfter).Inc()
351-
case result.Requeue:
351+
case result.Requeue: //nolint: staticcheck // We have to handle it until it is removed
352352
log.V(5).Info("Reconcile done, requeueing")
353353
c.Queue.AddRateLimited(req)
354354
ctrlmetrics.ReconcileTotal.WithLabelValues(c.Name, labelRequeue).Inc()

pkg/reconcile/reconcile.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,17 @@ import (
2828

2929
// Result contains the result of a Reconciler invocation.
3030
type Result struct {
31-
// Requeue tells the Controller to requeue the reconcile key. Defaults to false.
31+
// Requeue tells the Controller to perform a ratelimited requeue
32+
// using the workqueues ratelimiter. Defaults to false.
33+
//
34+
// This setting is deprecated as it causes confusion and there is
35+
// no good reason to use it. When waiting for an external event to
36+
// happen, either the duration until it is supposed to happen or an
37+
// appropriate poll interval should be used, rather than an
38+
// interval emitted by a ratelimiter whose purpose it is to control
39+
// retry on error.
40+
//
41+
// Deprecated: Use `RequeueAfter` instead.
3242
Requeue bool
3343

3444
// RequeueAfter if greater than 0, tells the Controller to requeue the reconcile key after the Duration.

0 commit comments

Comments
 (0)