-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Support delaying requeue for objectkey. #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pwittrock The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm We should discuss adding some sort of metadata/emoji to PR titles for "will this cause a major/minor/patch release" to make it easier to visually check on release and/or automate. |
/lgtm cancel Actually... |
c.Queue.AddRateLimited(req) | ||
return true | ||
if result.RequeueAfter != nil { | ||
c.Queue.AddAfter(req, *result.RequeueAfter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be forgetting with AddAfter
? This currently does...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, have one minor comment.
pkg/reconcile/reconcile.go
Outdated
"k8s.io/apimachinery/pkg/types" | ||
) | ||
|
||
// Result contains the result of a Reconciler invocation. | ||
type Result struct { | ||
// Requeue tells the Controller to requeue the reconcile key. Defaults to false. | ||
Requeue bool | ||
|
||
// RequeueAfter is the duration to wait before adding the key back to the queue. | ||
RequeueAfter *time.Duration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could avoid the pointer in this case by considering zero-value as indicator for not-to-requeue-after. I see that pointer introduces unnecessary verbosity in caller's code by having to declare a variable. WDYT ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
22042c1
to
5a52960
Compare
5a52960
to
83f4800
Compare
PTAL |
Support delaying requeue for objectkey.
This is a requirement for migrating cluster-api to controller-runtime.