Merge pull request #126980 from dims/fix-for-GenericPersistentVolume-disruptive-test-failures

Fix for GenericPersistentVolume/Disruptive test failures
This commit is contained in:
Kubernetes Prow Robot 2024-08-29 01:38:28 +01:00 committed by GitHub
commit eebc897e4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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]
}