mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-19 00:31:00 +00:00
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.
This commit is contained in:
parent
04362870ad
commit
d3503a2881
@ -749,7 +749,8 @@ func WaitForPersistentVolumeClaimsPhase(phase v1.PersistentVolumeClaimPhase, c c
|
|||||||
pvc, err := c.CoreV1().PersistentVolumeClaims(ns).Get(context.TODO(), pvcName, metav1.GetOptions{})
|
pvc, err := c.CoreV1().PersistentVolumeClaims(ns).Get(context.TODO(), pvcName, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
framework.Logf("Failed to get claim %q, retrying in %v. Error: %v", pvcName, Poll, err)
|
framework.Logf("Failed to get claim %q, retrying in %v. Error: %v", pvcName, Poll, err)
|
||||||
continue
|
phaseFoundInAllClaims = false
|
||||||
|
break
|
||||||
}
|
}
|
||||||
if pvc.Status.Phase == phase {
|
if pvc.Status.Phase == phase {
|
||||||
framework.Logf("PersistentVolumeClaim %s found and phase=%s (%v)", pvcName, phase, time.Since(start))
|
framework.Logf("PersistentVolumeClaim %s found and phase=%s (%v)", pvcName, phase, time.Since(start))
|
||||||
|
Loading…
Reference in New Issue
Block a user