mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 18:31:15 +00:00
Merge pull request #111555 from tallclair/pod-e2e-retry
Minor fixes to e2epod wait logic
This commit is contained in:
commit
719f3cf8da
@ -276,14 +276,15 @@ func WaitForPodCondition(c clientset.Interface, ns, podName, conditionDesc strin
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
if IsTimeout(err) && lastPod != nil {
|
||||
return TimeoutError(fmt.Sprintf("timed out while waiting for pod %s to be %s", podIdentifier(ns, podName), conditionDesc),
|
||||
lastPod,
|
||||
)
|
||||
}
|
||||
if lastPodError != nil {
|
||||
// If the last API call was an error.
|
||||
err = lastPodError
|
||||
if IsTimeout(err) {
|
||||
if lastPod != nil {
|
||||
return TimeoutError(fmt.Sprintf("timed out while waiting for pod %s to be %s", podIdentifier(ns, podName), conditionDesc),
|
||||
lastPod,
|
||||
)
|
||||
} else if lastPodError != nil {
|
||||
// If the last API call was an error, propagate that instead of the timeout error.
|
||||
err = lastPodError
|
||||
}
|
||||
}
|
||||
return maybeTimeoutError(err, "waiting for pod %s to be %s", podIdentifier(ns, podName), conditionDesc)
|
||||
}
|
||||
@ -713,7 +714,7 @@ func shouldRetry(err error) (retry bool, retryAfter time.Duration) {
|
||||
}
|
||||
|
||||
// these errors indicate a transient error that should be retried.
|
||||
if apierrors.IsInternalError(err) || apierrors.IsTimeout(err) || apierrors.IsTooManyRequests(err) {
|
||||
if apierrors.IsTimeout(err) || apierrors.IsTooManyRequests(err) {
|
||||
return true, 0
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user