kubectl icon indicating copy to clipboard operation
kubectl copied to clipboard

Drain Package Functions Should Use PollUntilContextTimeout and Return Properly Typed Errors

Open ugrkm opened this issue 1 year ago • 3 comments

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 avatar Jul 29 '24 15:07 ugrkm

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

ugrkm avatar Jul 30 '24 09:07 ugrkm

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

mpuckett159 avatar Aug 14 '24 16:08 mpuckett159

/assign

deveshidwivedi avatar Dec 05 '24 06:12 deveshidwivedi

This issue has not been updated in over 1 year, and should be re-triaged.

You can:

  • Confirm that this issue is still relevant with /triage accepted (org members only)
  • Close this issue with /close

For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/

/remove-triage accepted

k8s-triage-robot avatar Dec 05 '25 06:12 k8s-triage-robot