e2e: check isRetryableAPIError during polling

check isRetryableAPIError error when the
function is polling for the resouce.

updates: #1969

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2021-06-29 11:13:53 +05:30
committed by mergify[bot]
parent 3c773b24e5
commit 3e9172ab31
4 changed files with 31 additions and 11 deletions

View File

@ -27,6 +27,7 @@ func isRetryableAPIError(err error) bool {
apierrors.IsTooManyRequests(err) || utilnet.IsProbableEOF(err) || utilnet.IsConnectionReset(err) {
return true
}
// If the error sends the Retry-After header, we respect it as an explicit confirmation we should retry.
if _, shouldRetry := apierrors.SuggestsClientDelay(err); shouldRetry {
return true