Fix for GenericPersistentVolume/Disruptive test failures

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
Davanum Srinivas 2024-08-28 16:18:43 -04:00
parent e74205b08a
commit 8dc84eda9d
No known key found for this signature in database
GPG Key ID: 80D83A796103BF59

View File

@ -109,9 +109,6 @@ func createPodPVCFromSC(ctx context.Context, f *framework.Framework, c clientset
pvc, err = c.CoreV1().PersistentVolumeClaims(pvc.Namespace).Create(ctx, pvc, metav1.CreateOptions{})
framework.ExpectNoError(err, "Error creating pvc")
pvcClaims := []*v1.PersistentVolumeClaim{pvc}
pvs, err := e2epv.WaitForPVClaimBoundPhase(ctx, c, pvcClaims, framework.ClaimProvisionTimeout)
framework.ExpectNoError(err, "Failed waiting for PVC to be bound %v", err)
gomega.Expect(pvs).To(gomega.HaveLen(1))
ginkgo.By("Creating a pod with dynamically provisioned volume")
podConfig := e2epod.Config{
@ -121,5 +118,11 @@ func createPodPVCFromSC(ctx context.Context, f *framework.Framework, c clientset
}
pod, err := e2epod.CreateSecPod(ctx, c, &podConfig, f.Timeouts.PodStart)
framework.ExpectNoError(err, "While creating pods for kubelet restart test")
ginkgo.By("Checking for bound PVC")
pvs, err := e2epv.WaitForPVClaimBoundPhase(ctx, c, pvcClaims, framework.ClaimProvisionTimeout)
framework.ExpectNoError(err, "Failed waiting for PVC to be bound %v", err)
gomega.Expect(pvs).To(gomega.HaveLen(1))
return pod, pvc, pvs[0]
}