-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
✨ Make timeout to wait for blocked move global and configurable #9741
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@nojnhuh: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/cc @fabriziopandini |
blockLogged := false | ||
if err := retryWithExponentialBackoff(ctx, backoff, func(ctx context.Context) error { | ||
if err := c.Get(ctx, key, obj); err != nil { | ||
log.Info(fmt.Sprintf("Move blocked by %s annotation, waiting for it to be removed", clusterctlv1.BlockMoveAnnotation)) |
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.
I'm not super familiar clusterctl code base, how do you know this annotation is blocking here without checking for their existence?
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.
n.blockingMove
which is checked above is populated earlier in the flow by checking the annotation. This was added by #9246:
_, n.blockingMove = obj.GetAnnotations()[clusterctlv1.BlockMoveAnnotation] |
lgtm |
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 overall!
return errors.Wrapf(err, "error getting %s/%s", obj.GroupVersionKind(), key) | ||
} | ||
|
||
if _, exists := obj.GetAnnotations()[clusterctlv1.BlockMoveAnnotation]; exists { | ||
if !blockLogged { |
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.
Why do we no longer need this check? Is this just extra code that was supposed to be removed in #9246?
if err := c.Get(ctx, key, obj); err != nil { | ||
log.Info(fmt.Sprintf("Move blocked by %s annotation, waiting for it to be removed", clusterctlv1.BlockMoveAnnotation)) | ||
if err := retryWithExponentialBackoff(ctx, waitForResourceMoveUnblockedBackoff, func(ctx context.Context) error { | ||
if err := retryWithExponentialBackoff(ctx, getResourceBackoff, func(ctx context.Context) error { |
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.
Is getResourceBackoff
basically an interval to retry under the long waitForResourceMoveUnblockedBackoff
? I think a comment to explain this may help. I'm just a little confused about the nested retryWithExponentialBackoff
.
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
@nojnhuh Are you still working on this? Happy to pair sometime and get this over the finish line if you still need this feature. |
/close Feel free to reopen if you want to continue the work |
@sbueringer: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What this PR does / why we need it: Adds
--wait-for-unblock-timeout
toclusterctl
to customize how long to wait for all resources not to be blocking a move operation. This PR is split into two commits: one implements the timeout mechanism and the other exposes the value of the timeout as a command line flag.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #9194
/area clusterctl