-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Chores: Migrate deprecated wait.Poll*
to context-aware equivalents.
#13766
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
Chores: Migrate deprecated wait.Poll*
to context-aware equivalents.
#13766
Conversation
✅ Deploy Preview for kubernetes-ingress-nginx canceled.
|
Hi @oyiz-michael. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
0c59de7
to
3619318
Compare
3619318
to
7f53629
Compare
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.
/triage accepted
/kind cleanup
/priority backlog
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Gacko, oyiz-michael 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 |
/cherry-pick release-1.13 |
/cherry-pick release-1.12 |
@Gacko: once the present PR merges, I will cherry-pick it on top of 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. |
@Gacko: once the present PR merges, I will cherry-pick it on top of 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. |
wait.Poll*
to context-aware equivalents.
/ok-to-test |
@Gacko: new pull request created: #13781 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. |
@Gacko: new pull request created: #13782 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. |
/assign |
What this PR does / why we need it
Migrate all deprecated
wait.Poll*
usages to context-aware equivalents to remove deprecation warnings and align with current client-go patterns (maintenance scope per #13002). This improves timeout/cancellation handling and future-proofs the codebase without changing behavior.Changes
wait.PollUntil
→wait.PollUntilContextCancel
wait.Poll
/wait.PollImmediate
→wait.PollUntilContextTimeout
wait.ErrWaitTimeout
checks →ctx.Err() == context.DeadlineExceeded
Types of changes
Which issue/s this PR fixes
N/A — proactive maintenance/refactor aligned with project status (#13002).
How Has This Been Tested?
Example migration
Before (deprecated):
err := wait.PollImmediate(1*time.Second, timeout, func() (bool, error) {
// ...
})
if err == wait.ErrWaitTimeout {
// handle timeout
}
After (context-aware):
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
err := wait.PollUntilContextTimeout(ctx, 1*time.Second, timeout, true, func(ctx context.Context) (bool, error) {
// ...
})
if ctx.Err() == context.DeadlineExceeded {
// handle timeout
}
Checklist: