Merge pull request #120559 from pohly/e2e-framework-WaitForPodsResponding-retry

e2e pods: fix WaitForPodsResponding retry
This commit is contained in:
Kubernetes Prow Robot 2023-09-11 07:52:10 -07:00 committed by GitHub
commit b1161a8ac4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -581,10 +581,11 @@ func WaitForPodsResponding(ctx context.Context, c clientset.Interface, ns string
if err != nil { if err != nil {
// We may encounter errors here because of a race between the pod readiness and apiserver // We may encounter errors here because of a race between the pod readiness and apiserver
// proxy. So, we log the error and retry if this occurs. // proxy or because of temporary failures. The error gets wrapped for framework.HandleRetry.
return nil, fmt.Errorf("Controller %s: failed to Get from replica pod %s:\n%s\nPod status:\n%s", // Gomega+Ginkgo will handle logging.
return nil, fmt.Errorf("controller %s: failed to Get from replica pod %s:\n%w\nPod status:\n%s",
controllerName, pod.Name, controllerName, pod.Name,
format.Object(err, 1), format.Object(pod.Status, 1)) err, format.Object(pod.Status, 1))
} }
responses = append(responses, response{podName: pod.Name, response: string(body)}) responses = append(responses, response{podName: pod.Name, response: string(body)})
} }