From d3503a28816598caae35974fec1471c7365497b5 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Tue, 11 Aug 2020 10:57:42 +0200 Subject: [PATCH] Fix waiting for PVCs to get Bound When Get() returns error, the loop should not return with nil. Make sure that the faulty Get() marks phaseFoundInAllClaims as not satisfied. --- test/e2e/framework/pv/pv.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/e2e/framework/pv/pv.go b/test/e2e/framework/pv/pv.go index f778e40d2b9..949aa8f4d71 100644 --- a/test/e2e/framework/pv/pv.go +++ b/test/e2e/framework/pv/pv.go @@ -749,7 +749,8 @@ func WaitForPersistentVolumeClaimsPhase(phase v1.PersistentVolumeClaimPhase, c c pvc, err := c.CoreV1().PersistentVolumeClaims(ns).Get(context.TODO(), pvcName, metav1.GetOptions{}) if err != nil { framework.Logf("Failed to get claim %q, retrying in %v. Error: %v", pvcName, Poll, err) - continue + phaseFoundInAllClaims = false + break } if pvc.Status.Phase == phase { framework.Logf("PersistentVolumeClaim %s found and phase=%s (%v)", pvcName, phase, time.Since(start))