e2e framework retry on Service unavailable errors

the e2e framwork use active loops to wait for certain async operations,
these loops need to retry on some operations and fail in others.

For the functions that depend on some operations to happen, the
apiserver may return 503 errors until that specific service is
available, so we should retry on those too.

Change-Id: Ib3d194184f6385b9d3d151c7055f27c97c21c3ff
This commit is contained in:
Antonio Ojea 2023-05-25 11:20:08 +00:00
parent bc6cbdabbe
commit e31b2080f5

View File

@ -100,7 +100,10 @@ func ShouldRetry(err error) (retry bool, retryAfter time.Duration) {
}
// these errors indicate a transient error that should be retried.
if apierrors.IsTimeout(err) || apierrors.IsTooManyRequests(err) || errors.As(err, &transientError{}) {
if apierrors.IsTimeout(err) ||
apierrors.IsTooManyRequests(err) ||
apierrors.IsServiceUnavailable(err) ||
errors.As(err, &transientError{}) {
return true, 0
}