[e2epod] wait: Don't override non-timeout errors
This commit is contained in:
@@ -276,15 +276,16 @@ func WaitForPodCondition(c clientset.Interface, ns, podName, conditionDesc strin
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
if IsTimeout(err) && lastPod != nil {
|
||||
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,
|
||||
)
|
||||
}
|
||||
if lastPodError != nil {
|
||||
// If the last API call was an error.
|
||||
} 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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user