Skip to content
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

Drain Package Functions Should Use PollUntilContextTimeout and Return Properly Typed Errors #1627

Open
ugrkm opened this issue Jul 29, 2024 · 2 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@ugrkm
Copy link

ugrkm commented Jul 29, 2024

Drain package function waitForDelete uses wait.PollImmediate. That function is deprecated and instead PollUntilContextTimeout should be used.
In addition, we cannot check the returned error from waitForDelete function with wait.Interrupted because the function returns an error with fmt.Errorf.

What would you like to be added:
Instead of using wait.PollImmediate, we should switch to PollUntilContextTimeout . Also, the waitForDelete should return an error of type ErrorInterrupted.

Why is this needed:
wait.PollImmediate is deprecated. The current returned error is hard to check and requires string comparison.

@ugrkm ugrkm added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 29, 2024
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jul 29, 2024
@ugrkm
Copy link
Author

ugrkm commented Jul 30, 2024

I am happy to work on this, if this change sounds reasonable.

@mpuckett159
Copy link
Contributor

/triage accepted
We would accept a PR for this, thank you for offering to help with this @ugrkm

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

3 participants