Skip to content

Commit 0f95c04

Browse files
committed
e2e: create pod before resizing
Creating a pod before resizing the pvc. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
1 parent 100f858 commit 0f95c04

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

e2e/rbd.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6815,6 +6815,17 @@ var _ = Describe("RBD", func() {
68156815
logAndFail("failed to validate QoS before expansion: %v", err)
68166816
}
68176817

6818+
app, err = loadApp(appPath)
6819+
if err != nil {
6820+
logAndFail("failed to load app: %v", err)
6821+
}
6822+
app.Namespace = f.UniqueName
6823+
app.Spec.Volumes[0].PersistentVolumeClaim.ClaimName = pvcExpand.Name
6824+
err = createApp(f.ClientSet, app, deployTimeout)
6825+
if err != nil {
6826+
logAndFail("failed to create app: %v", err)
6827+
}
6828+
68186829
// Expand volume
68196830
err = expandPVCSize(f.ClientSet, pvcExpand, "2Gi", deployTimeout)
68206831
if err != nil {
@@ -6827,6 +6838,11 @@ var _ = Describe("RBD", func() {
68276838
logAndFail("failed to validate QoS after expansion: %v", err)
68286839
}
68296840

6841+
err = deletePod(app.Name, app.Namespace, f.ClientSet, deployTimeout)
6842+
if err != nil {
6843+
logAndFail("failed to delete app: %v", err)
6844+
}
6845+
68306846
err = deletePVCAndValidatePV(f.ClientSet, pvcExpand, deployTimeout)
68316847
if err != nil {
68326848
logAndFail("failed to delete expanded PVC: %v", err)

e2e/resize.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ func expandPVCSize(c kubernetes.Interface, pvc *v1.PersistentVolumeClaim, size s
4949
Expect(err).ShouldNot(HaveOccurred())
5050

5151
start := time.Now()
52-
framework.Logf("Waiting up to %v to be in Resized state", pvc)
52+
framework.Logf("Waiting up to %v to be in Resized state", updatedPVC)
5353

5454
return wait.PollUntilContextTimeout(ctx, poll, timeout, true, func(ctx context.Context) (bool, error) {
55-
framework.Logf("waiting for PVC %s (%d seconds elapsed)", pvcName, int(time.Since(start).Seconds()))
55+
framework.Logf("waiting for PVC %s to be resized (%d seconds elapsed)", pvcName, int(time.Since(start).Seconds()))
5656
updatedPVC, err = c.CoreV1().
5757
PersistentVolumeClaims(pvcNamespace).
5858
Get(ctx, pvcName, metav1.GetOptions{})
@@ -66,6 +66,9 @@ func expandPVCSize(c kubernetes.Interface, pvc *v1.PersistentVolumeClaim, size s
6666
}
6767
pvcConditions := updatedPVC.Status.Conditions
6868
if len(pvcConditions) > 0 {
69+
for _, con := range pvcConditions {
70+
framework.Logf("pvc %s condition %v", pvcName, con)
71+
}
6972
framework.Logf("pvc state %v", pvcConditions[0].Type)
7073
if pvcConditions[0].Type == v1.PersistentVolumeClaimResizing ||
7174
pvcConditions[0].Type == v1.PersistentVolumeClaimFileSystemResizePending {

0 commit comments

Comments
 (0)