Skip to content

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

Merged
merged 1 commit into from
Sep 5, 2018

Conversation

pwittrock
Copy link
Contributor

This is a requirement for migrating cluster-api to controller-runtime.

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 1, 2018
@DirectXMan12
Copy link
Contributor

/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.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 4, 2018
@DirectXMan12
Copy link
Contributor

/lgtm cancel

Actually...

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 4, 2018
c.Queue.AddRateLimited(req)
return true
if result.RequeueAfter != nil {
c.Queue.AddAfter(req, *result.RequeueAfter)
Copy link
Contributor

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...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Done

Copy link
Contributor

@droot droot left a 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.

"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
Copy link
Contributor

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 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@pwittrock
Copy link
Contributor Author

PTAL

@droot droot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 5, 2018
@k8s-ci-robot k8s-ci-robot merged commit d4dff20 into kubernetes-sigs:master Sep 5, 2018
justinsb pushed a commit to justinsb/controller-runtime that referenced this pull request Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants