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.
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.