Drain Package Functions Should Use PollUntilContextTimeout and Return Properly Typed Errors #1627
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.
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.
The text was updated successfully, but these errors were encountered: