mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 20:17:41 +00:00
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:
parent
bc6cbdabbe
commit
e31b2080f5
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user