-
Notifications
You must be signed in to change notification settings - Fork 1.4k
🌱 Migrate from Requeue to RequeueAfter in kcp #13028
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
base: main
Are you sure you want to change the base?
🌱 Migrate from Requeue to RequeueAfter in kcp #13028
Conversation
Signed-off-by: sivchari <[email protected]>
|
This PR is currently missing an area label, which is used to identify the modified component when generating release notes. Area labels can be added by org members by writing Please see the labels list for possible areas. 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. |
Signed-off-by: sivchari <[email protected]>
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.
Mix them without separating.
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 just intentionally added these in the PR merged yesterday. Please keep them (please see the godocs I explicitly added to the nolint statements)
(please revert all changes to this file, this util will soon'ish also be used in other controller / repos. It has to handle Requeue appropriately and must have the corresponding unit test coverage for it)
|
@sivchari: 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-sigs/prow repository. I understand the commands that are listed here. |
neolit123
left a comment
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.
/approve
given this PR is a task from the parent issue.
- how are we deciding on 10 seconds vs 20 seconds in various places?
- should we add some constants in a central file?
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: neolit123 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 |
| log.Error(err, "Failed to configure the patch helper") | ||
| return ctrl.Result{Requeue: true}, nil | ||
| return ctrl.Result{RequeueAfter: 20 * time.Second}, nil |
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.
This should just be (this is pretty old code :))
return ctrl.Result{}, err
(also drop the log in l.214)
| // Get the workload cluster client. | ||
| workloadCluster, err := controlPlane.GetWorkloadCluster(ctx) | ||
| if err != nil { | ||
| log.V(2).Info("cannot get remote client to workload cluster, will requeue", "cause", err) |
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.
Same here, let's just drop the log and return the error directly (and use an empty result)
| }) | ||
|
|
||
| return ctrl.Result{Requeue: true}, nil | ||
| return ctrl.Result{RequeueAfter: 20 * time.Second}, nil |
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.
| return ctrl.Result{RequeueAfter: 20 * time.Second}, nil | |
| return ctrl.Result{}, nil // No need to requeue here. Machine deletion above triggers reconciliation. |
|
|
||
| // Requeue the control plane, in case there are additional operations to perform | ||
| return ctrl.Result{Requeue: true}, nil | ||
| return ctrl.Result{RequeueAfter: 20 * time.Second}, nil |
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.
| return ctrl.Result{RequeueAfter: 20 * time.Second}, nil | |
| return ctrl.Result{}, nil // No need to requeue here. Machine creation above triggers reconciliation. |
|
|
||
| // Requeue the control plane, in case there are other operations to perform | ||
| return ctrl.Result{Requeue: true}, nil | ||
| return ctrl.Result{RequeueAfter: 20 * time.Second}, nil |
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.
| return ctrl.Result{RequeueAfter: 20 * time.Second}, nil | |
| return ctrl.Result{}, nil // No need to requeue here. Machine creation above triggers reconciliation. |
|
|
||
| // Requeue the control plane, in case there are additional operations to perform | ||
| return ctrl.Result{Requeue: true}, nil | ||
| return ctrl.Result{RequeueAfter: 20 * time.Second}, nil |
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.
| return ctrl.Result{RequeueAfter: 20 * time.Second}, nil | |
| return ctrl.Result{}, nil // No need to requeue here. Machine deletion above triggers reconciliation. |
|
|
||
| result, err := r.initializeControlPlane(ctx, controlPlane) | ||
| g.Expect(result).To(BeComparableTo(ctrl.Result{Requeue: true})) | ||
| g.Expect(result.RequeueAfter).To(Equal(20 * time.Second)) |
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.
please change the unit tests (also in other files) to check for result.IsZero to BeTrue() (where applicable)
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 just intentionally added these in the PR merged yesterday. Please keep them (please see the godocs I explicitly added to the nolint statements)
(please revert all changes to this file, this util will soon'ish also be used in other controller / repos. It has to handle Requeue appropriately and must have the corresponding unit test coverage for it)
|
/hold Until the findings are resolved |
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Part of #12272