Skip to content

Commit 948b754

Browse files
authored
adding tkg snapshot usecases in ef uts column (#3586)
1 parent 94572ce commit 948b754

File tree

2 files changed

+105
-100
lines changed

2 files changed

+105
-100
lines changed

tests/e2e/csi_snapshot_basic.go

Lines changed: 102 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
245245
*/
246246

247247
ginkgo.It("[cf-wcp] [cf-vanilla-block][block-vanilla-snapshot] [tkg-snapshot][supervisor-snapshot]"+
248-
" Verify snapshot dynamic provisioning workflow", ginkgo.Label(p0, block, tkg,
248+
"[ef-vks-snapshot] Verify snapshot dynamic provisioning workflow", ginkgo.Label(p0, block, tkg,
249249
vanilla, wcp, snapshot, stable, vc90), func() {
250250
ctx, cancel := context.WithCancel(context.Background())
251251
defer cancel()
@@ -1330,9 +1330,9 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
13301330
16. Query the snapshot from CNS side - it shouldn't be available
13311331
17. Delete SC and VolumeSnapshotClass
13321332
*/
1333-
ginkgo.It("[cf-vks][cf-vanilla-block][block-vanilla-snapshot][tkg-snapshot] Volume snapshot "+
1334-
"creation and restoration workflow with xfs filesystem", ginkgo.Label(p0, block,
1335-
vanilla, tkg, snapshot, stable, vc80), func() {
1333+
ginkgo.It("[cf-vks][cf-vanilla-block][block-vanilla-snapshot][tkg-snapshot]"+
1334+
"[ef-vks-snapshot] Volume snapshot creation and restoration workflow with xfs "+
1335+
"filesystem", ginkgo.Label(p0, block, vanilla, tkg, snapshot, stable, vc80), func() {
13361336

13371337
ctx, cancel := context.WithCancel(context.Background())
13381338
defer cancel()
@@ -1528,9 +1528,9 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
15281528
while the source pvc was created usig thin provisioned psp-operatorlicy
15291529
6. cleanup spbm policies, sc's, pvc's
15301530
*/
1531-
ginkgo.It("[cf-wcp] [cf-vanilla-block][block-vanilla-snapshot][tkg-snapshot] [supervisor-snapshot]"+
1532-
" Volume restore using snapshot on a different storageclass", ginkgo.Label(p0, block, vanilla,
1533-
wcp, snapshot, tkg, stable, vc90), func() {
1531+
ginkgo.It("[cf-wcp] [cf-vanilla-block][block-vanilla-snapshot][tkg-snapshot][supervisor-snapshot]"+
1532+
"[ef-vks-snapshot] Volume restore using snapshot on a different storageclass", ginkgo.Label(p0, block,
1533+
vanilla, wcp, snapshot, tkg, stable, vc90), func() {
15341534

15351535
ctx, cancel := context.WithCancel(context.Background())
15361536
defer cancel()
@@ -1667,9 +1667,9 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
16671667
8. Ensure the pvc with source as snapshot creates successfully and is bound
16681668
9. Cleanup the snapshot, pvcs and ns
16691669
*/
1670-
ginkgo.It("[block-vanilla-snapshot][cf-vanilla-block][tkg-snapshot] Delete the namespace hosting the pvcs and "+
1671-
"volume-snapshots and recover the data using snapshot-content", ginkgo.Label(p0, block,
1672-
vanilla, snapshot, tkg, stable, vc80), func() {
1670+
ginkgo.It("[block-vanilla-snapshot][cf-vanilla-block][tkg-snapshot][ef-vks-snapshot] Delete the "+
1671+
"namespace hosting the pvcs and volume-snapshots and recover the data using "+
1672+
"snapshot-content", ginkgo.Label(p0, block, vanilla, snapshot, tkg, stable, vc80), func() {
16731673

16741674
ctx, cancel := context.WithCancel(context.Background())
16751675
defer cancel()
@@ -1958,8 +1958,9 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
19581958
designed to return success even though it cannot find a snapshot in the backend)
19591959
*/
19601960

1961-
ginkgo.It("[cf-wcp] [block-vanilla-snapshot] [tkg-snapshot][supervisor-snapshot] Delete a non-existent "+
1962-
"snapshot", ginkgo.Label(p0, block, vanilla, wcp, snapshot, tkg, negative, vc90), func() {
1961+
ginkgo.It("[cf-wcp] [block-vanilla-snapshot] [tkg-snapshot][supervisor-snapshot]"+
1962+
"[ef-vks-cnapshot] Delete a non-existent snapshot", ginkgo.Label(p0, block, vanilla,
1963+
wcp, snapshot, tkg, negative, vc90), func() {
19631964

19641965
ctx, cancel := context.WithCancel(context.Background())
19651966
defer cancel()
@@ -2041,7 +2042,7 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
20412042
*/
20422043

20432044
ginkgo.It("[cf-wcp][cf-vanilla-block][block-vanilla-snapshot] [tkg-snapshot][supervisor-snapshot]"+
2044-
" Create snapshots using default VolumeSnapshotClass", ginkgo.Label(p0, block,
2045+
"[ef-vks-snapshot] Create snapshots using default VolumeSnapshotClass", ginkgo.Label(p0, block,
20452046
vanilla, snapshot, wcp, tkg, vc90), func() {
20462047

20472048
ctx, cancel := context.WithCancel(context.Background())
@@ -2275,7 +2276,8 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
22752276
10. Verify if the new pod attaches to the PV created in step-8
22762277
11. Cleanup the sts and the snapshot + pv that was left behind in step-7
22772278
*/
2278-
ginkgo.It("[ef-wcp-snapshot][block-vanilla-snapshot][tkg-snapshot][supervisor-snapshot] Snapshot workflow for "+
2279+
ginkgo.It("[ef-wcp-snapshot][block-vanilla-snapshot][tkg-snapshot]"+
2280+
"[supervisor-snapshot] [ef-vks-snapshot] Snapshot workflow for "+
22792281
"statefulsets", ginkgo.Label(p0, block, vanilla, snapshot, wcp, tkg, vc80), func() {
22802282
ctx, cancel := context.WithCancel(context.Background())
22812283
defer cancel()
@@ -2626,7 +2628,7 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
26262628
4. create a pre-provisioned snapshot (which uses VolumeSnapshotContent as source) using the VSC from step(3)
26272629
5. Ensure this provisioning fails with appropriate error: SnapshotContentMismatch error
26282630
*/
2629-
ginkgo.It("[block-vanilla-snapshot] [tkg-snapshot] Create a pre-provisioned snapshot using "+
2631+
ginkgo.It("[block-vanilla-snapshot] [tkg-snapshot][ef-vks-snapshot] Create a pre-provisioned snapshot using "+
26302632
"VolumeSnapshotContent as source", ginkgo.Label(p1, block, vanilla, snapshot, tkg, stable,
26312633
negative, vc80), func() {
26322634

@@ -3032,7 +3034,7 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
30323034
*/
30333035

30343036
ginkgo.It("[ef-wcp-snapshot][cf-vanilla-block][block-vanilla-snapshot] [tkg-snapshot]"+
3035-
"[supervisor-snapshot] Snapshot workflow for deployments", ginkgo.Label(p0, block,
3037+
"[supervisor-snapshot] [ef-vks-snapshot] Snapshot workflow for deployments", ginkgo.Label(p0, block,
30363038
vanilla, tkg, snapshot, wcp, stable, vc80), func() {
30373039

30383040
ctx, cancel := context.WithCancel(context.Background())
@@ -3179,7 +3181,7 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
31793181
7. Cleanup the pvc
31803182
*/
31813183
ginkgo.It("[ef-wcp-snapshot][cf-vanilla-block][block-vanilla-snapshot] [tkg-snapshot]"+
3182-
"[supervisor-snapshot] Volume offline resize of a volume having snapshots", ginkgo.Label(p0, block,
3184+
"[supervisor-snapshot] Verify offline resize of a volume having snapshots", ginkgo.Label(p0, block,
31833185
vanilla, tkg, snapshot, stable, wcp, negative, vc90), func() {
31843186

31853187
ctx, cancel := context.WithCancel(context.Background())
@@ -4251,8 +4253,9 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
42514253
8. Cleanup all the snapshots and the pvc.
42524254
*/
42534255

4254-
ginkgo.It("[ef-wcp-snapshot][block-vanilla-snapshot][tkg-snapshot][supervisor-snapshot] Multi-master and "+
4255-
"snapshot workflow", ginkgo.Label(p1, block, vanilla, tkg, snapshot, vc80), func() {
4256+
ginkgo.It("[ef-wcp-snapshot][block-vanilla-snapshot][tkg-snapshot][supervisor-snapshot]"+
4257+
"[ef-vks-snapshot] Multi-master and snapshot workflow", ginkgo.Label(p1, block, vanilla,
4258+
tkg, snapshot, vc80), func() {
42564259

42574260
ctx, cancel := context.WithCancel(context.Background())
42584261
defer cancel()
@@ -4903,6 +4906,7 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
49034906
2. Create Snapshot class and take a snapshot of the volume
49044907
3. Cleanup of snapshot, pvc and sc
49054908
*/
4909+
49064910
ginkgo.It("[pq-wcp-snpt][block-vanilla-snapshot][tkg-snapshot] [supervisor-snapshot] Volume provision and "+
49074911
"snapshot creation/restore on VMFS Datastore", ginkgo.Label(p0, block, vanilla, snapshot,
49084912
tkg, vc80), func() {
@@ -4917,9 +4921,9 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
49174921
2. Create Snapshot class and take a snapshot of the volume
49184922
3. Cleanup of snapshot, pvc and sc
49194923
*/
4920-
ginkgo.It("[ef-wcp-snapshot][block-vanilla-snapshot][tkg-snapshot] [supervisor-snapshot] Volume provision and "+
4921-
"snapshot creation/restore on NFS Datastore", ginkgo.Label(p0, block, vanilla, snapshot,
4922-
tkg, vc80), func() {
4924+
ginkgo.It("[ef-wcp-snapshot][block-vanilla-snapshot][tkg-snapshot] [supervisor-snapshot]"+
4925+
"[ef-vks-snapshot] Volume provision and snapshot creation/restore on NFS Datastore", ginkgo.Label(p0,
4926+
block, vanilla, snapshot, tkg, vc80), func() {
49234927
ctx, cancel := context.WithCancel(context.Background())
49244928
defer cancel()
49254929
invokeSnapshotOperationsOnSharedDatastore(client, ctx, namespace, scParameters, snapc, "NFS", pandoraSyncWaitTime)
@@ -4960,8 +4964,9 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
49604964
4. Volume restore
49614965
5. snapshot create/delete workflow
49624966
*/
4963-
ginkgo.It("[ef-wcp-snapshot][block-vanilla-snapshot][tkg-snapshot][supervisor-snapshot] Scale-up creation "+
4964-
"of snapshots across multiple volumes", ginkgo.Label(p1, block, vanilla, snapshot, tkg, stable, vc80), func() {
4967+
ginkgo.It("[ef-wcp-snapshot][block-vanilla-snapshot][tkg-snapshot][supervisor-snapshot][ef-vks-snapshot] Scale-up "+
4968+
"creation of snapshots across multiple volumes", ginkgo.Label(p1, block, vanilla, snapshot,
4969+
tkg, stable, vc80), func() {
49654970

49664971
ctx, cancel := context.WithCancel(context.Background())
49674972
defer cancel()
@@ -5103,8 +5108,8 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
51035108
5. Perform cleanup
51045109
*/
51055110

5106-
ginkgo.It("[tkg-snapshot] Verify pre-provisioned static snapshot workflow", ginkgo.Label(p0, snapshot,
5107-
tkg, vc80), func() {
5111+
ginkgo.It("[tkg-snapshot][ef-vks-snapshot] Verify pre-provisioned static snapshot "+
5112+
"workflow", ginkgo.Label(p0, snapshot, tkg, vc80), func() {
51085113
ctx, cancel := context.WithCancel(context.Background())
51095114
defer cancel()
51105115

@@ -5216,7 +5221,7 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
52165221
10. Run cleanup: Delete snapshots, restored-volumes, pods
52175222
*/
52185223

5219-
ginkgo.It("[tkg-snapshot] Volume restore using dynamic and pre-provisioned snapshot on "+
5224+
ginkgo.It("[tkg-snapshot][ef-vks-snapshot] Volume restore using dynamic and pre-provisioned snapshot on "+
52205225
"guest cluster", ginkgo.Label(p0, snapshot, tkg, flaky, vc80), func() {
52215226

52225227
ctx, cancel := context.WithCancel(context.Background())
@@ -5402,8 +5407,8 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
54025407
(note the snapshotHandle its pointing to has been deleted)
54035408
8. Volume Create should fail with an appropriate error on k8s side
54045409
*/
5405-
ginkgo.It("[tkg-snapshot] Restore volume using non-existing static snapshot", ginkgo.Label(p0, snapshot, tkg,
5406-
vc80), func() {
5410+
ginkgo.It("[tkg-snapshot][ef-vks-snapshot] Restore volume using non-existing static "+
5411+
"snapshot", ginkgo.Label(p0, snapshot, tkg, vc80), func() {
54075412

54085413
ctx, cancel := context.WithCancel(context.Background())
54095414
defer cancel()
@@ -5531,8 +5536,8 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
55315536
7. Validate the pvc is Bound
55325537
8. Cleanup the snapshot and pvc
55335538
*/
5534-
ginkgo.It("[tkg-snapshot] Restore volume from a static snapshot that is still not "+
5535-
"ready-to-use", ginkgo.Label(p0, snapshot, tkg, vc80), func() {
5539+
ginkgo.It("[tkg-snapshot][ef-vks-snapshot] Restore volume from a static snapshot "+
5540+
"that is still not ready-to-use", ginkgo.Label(p0, snapshot, tkg, vc80), func() {
55365541

55375542
ctx, cancel := context.WithCancel(context.Background())
55385543
defer cancel()
@@ -5703,8 +5708,8 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
57035708
9. Run cleanup: Delete snapshots, restored-volumes, pods.
57045709
*/
57055710

5706-
ginkgo.It("[ef-wcp-snapshot][tkg-snapshot][supervisor-snapshot] Perform online resize on restored "+
5707-
"volume", ginkgo.Label(p0, snapshot, tkg, stable, vc80), func() {
5711+
ginkgo.It("[ef-wcp-snapshot][tkg-snapshot][supervisor-snapshot][ef-vks-snapshot] Perform online "+
5712+
"resize on restored volume", ginkgo.Label(p0, snapshot, tkg, stable, vc80), func() {
57085713
ctx, cancel := context.WithCancel(context.Background())
57095714
defer cancel()
57105715

@@ -5905,8 +5910,8 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
59055910
7. Run cleanup: Delete snapshots, restored-volumes, pods.
59065911
*/
59075912

5908-
ginkgo.It("[ef-wcp-snapshot][tkg-snapshot][supervisor-snapshot] Offline relocation of FCD "+
5909-
"with snapshots", ginkgo.Label(p0, snapshot, tkg, stable, vc80), func() {
5913+
ginkgo.It("[ef-wcp-snapshot][tkg-snapshot][supervisor-snapshot][ef-vks-snapshot] Offline "+
5914+
"relocation of FCD with snapshots", ginkgo.Label(p0, snapshot, tkg, stable, vc80), func() {
59105915

59115916
ctx, cancel := context.WithCancel(context.Background())
59125917
defer cancel()
@@ -6180,7 +6185,7 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
61806185
5. Restore PVC creation should fail and be stuck in Pending state with appropriate error message.
61816186
6. Perform Cleanup.
61826187
*/
6183-
ginkgo.It("[ef-wcp-snapshot][tkg-snapshot][supervisor-snapshot] Volume mode "+
6188+
ginkgo.It("[ef-wcp-snapshot][tkg-snapshot][supervisor-snapshot][ef-vks-snapshot] Volume mode "+
61846189
"conversion", ginkgo.Label(p2, snapshot, tkg, newTest, stable, negative, vc90), func() {
61856190

61866191
ctx, cancel := context.WithCancel(context.Background())
@@ -6288,7 +6293,7 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
62886293
Should fail with an appropriate error
62896294
*/
62906295

6291-
ginkgo.It("[tkg-snapshot] Volume snapshot creation on a file-share volume on a guest "+
6296+
ginkgo.It("[tkg-snapshot][ef-vks-snapshot] Volume snapshot creation on a file-share volume on a guest "+
62926297
"cluster", ginkgo.Label(p1, snapshot, tkg, newTest, negative, stable, vc80), func() {
62936298

62946299
ctx, cancel := context.WithCancel(context.Background())
@@ -6334,7 +6339,7 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
63346339
Run cleanup: Delete snapshots, restored-volumes, pods.
63356340
*/
63366341

6337-
ginkgo.It("[ef-wcp-snapshot][tkg-snapshot][supervisor-snapshot] Create restore volume snapshot "+
6342+
ginkgo.It("[ef-wcp-snapshot][tkg-snapshot][supervisor-snapshot][ef-vks-snapshot] Create restore volume snapshot "+
63386343
"in consistent order", ginkgo.Label(p0, snapshot, tkg, stable, vc90), func() {
63396344

63406345
ctx, cancel := context.WithCancel(context.Background())
@@ -6509,7 +6514,7 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
65096514
8. Perform cleanup.
65106515
*/
65116516

6512-
ginkgo.It("[ef-wcp-snapshot][tkg-snapshot][supervisor-snapshot] Detach volume with "+
6517+
ginkgo.It("[ef-wcp-snapshot][tkg-snapshot][supervisor-snapshot][ef-vks-snapshot] Detach volume with "+
65136518
"snapshot", ginkgo.Label(p1, snapshot, tkg, newTest, stable, vc90), func() {
65146519

65156520
ctx, cancel := context.WithCancel(context.Background())
@@ -6636,7 +6641,7 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
66366641
9. Delete all the above created PV, PVC and resource quota.
66376642
*/
66386643

6639-
ginkgo.It("[tkg-snapshot] Provisioning of static volume on guest cluster using FCD with snapshot "+
6644+
ginkgo.It("[tkg-snapshot][ef-vks-snapshot] Provisioning of static volume on guest cluster using FCD with snapshot "+
66406645
"creation", ginkgo.Label(p0, snapshot, tkg, stable, vc90), func() {
66416646

66426647
var err error
@@ -7036,74 +7041,74 @@ var _ = ginkgo.Describe("Volume Snapshot Basic Test", func() {
70367041
10. Run cleanup: Delete snapshots, restored-volumes, pods
70377042
*/
70387043

7039-
ginkgo.It("[ef-wcp-snapshot][tkg-snapshot][supervisor-snapshot] Max Snapshots per volume on wcp and gc",
7040-
ginkgo.Label(p1, snapshot, tkg, vc90), func() {
7044+
ginkgo.It("[ef-wcp-snapshot][tkg-snapshot][supervisor-snapshot][ef-vks-snapshot] Max Snapshots per volume on wcp "+
7045+
"and gc", ginkgo.Label(p1, snapshot, tkg, vc90), func() {
70417046

7042-
ctx, cancel := context.WithCancel(context.Background())
7043-
defer cancel()
7047+
ctx, cancel := context.WithCancel(context.Background())
7048+
defer cancel()
70447049

7045-
var volumeSnapshots []*snapV1.VolumeSnapshot
7046-
var snapshotIds []string
7047-
snapDeleted := false
7048-
noOfSnapshotToCreate := 33
7050+
var volumeSnapshots []*snapV1.VolumeSnapshot
7051+
var snapshotIds []string
7052+
snapDeleted := false
7053+
noOfSnapshotToCreate := 33
70497054

7050-
ginkgo.By("Get storage class")
7051-
storageclass, err := createStorageClass(client, scParameters, nil, "", "", false, scName)
7052-
if !apierrors.IsNotFound(err) {
7053-
gomega.Expect(err).NotTo(gomega.HaveOccurred())
7054-
}
7055+
ginkgo.By("Get storage class")
7056+
storageclass, err := createStorageClass(client, scParameters, nil, "", "", false, scName)
7057+
if !apierrors.IsNotFound(err) {
7058+
gomega.Expect(err).NotTo(gomega.HaveOccurred())
7059+
}
70557060

7056-
ginkgo.By("Create PVC")
7057-
pvclaim, persistentVolumes, err := createPVCAndQueryVolumeInCNS(ctx, client, namespace, labelsMap, v1.ReadWriteOnce,
7058-
diskSize, storageclass, true)
7061+
ginkgo.By("Create PVC")
7062+
pvclaim, persistentVolumes, err := createPVCAndQueryVolumeInCNS(ctx, client, namespace, labelsMap, v1.ReadWriteOnce,
7063+
diskSize, storageclass, true)
7064+
gomega.Expect(err).NotTo(gomega.HaveOccurred())
7065+
volHandle = persistentVolumes[0].Spec.CSI.VolumeHandle
7066+
if guestCluster {
7067+
volHandle = getVolumeIDFromSupervisorCluster(volHandle)
7068+
}
7069+
gomega.Expect(volHandle).NotTo(gomega.BeEmpty())
7070+
defer func() {
7071+
err := fpv.DeletePersistentVolumeClaim(ctx, client, pvclaim.Name, namespace)
70597072
gomega.Expect(err).NotTo(gomega.HaveOccurred())
7060-
volHandle = persistentVolumes[0].Spec.CSI.VolumeHandle
7061-
if guestCluster {
7062-
volHandle = getVolumeIDFromSupervisorCluster(volHandle)
7063-
}
7064-
gomega.Expect(volHandle).NotTo(gomega.BeEmpty())
7065-
defer func() {
7066-
err := fpv.DeletePersistentVolumeClaim(ctx, client, pvclaim.Name, namespace)
7067-
gomega.Expect(err).NotTo(gomega.HaveOccurred())
7068-
err = e2eVSphere.waitForCNSVolumeToBeDeleted(volHandle)
7069-
gomega.Expect(err).NotTo(gomega.HaveOccurred())
7070-
}()
7073+
err = e2eVSphere.waitForCNSVolumeToBeDeleted(volHandle)
7074+
gomega.Expect(err).NotTo(gomega.HaveOccurred())
7075+
}()
70717076

7072-
ginkgo.By("Get volume snapshot class")
7073-
volumeSnapshotClass, err := createVolumeSnapshotClass(ctx, snapc, deletionPolicy)
7074-
if !apierrors.IsNotFound(err) {
7075-
gomega.Expect(err).NotTo(gomega.HaveOccurred())
7076-
}
7077+
ginkgo.By("Get volume snapshot class")
7078+
volumeSnapshotClass, err := createVolumeSnapshotClass(ctx, snapc, deletionPolicy)
7079+
if !apierrors.IsNotFound(err) {
7080+
gomega.Expect(err).NotTo(gomega.HaveOccurred())
7081+
}
70777082

7078-
for i := 0; i < noOfSnapshotToCreate; i++ {
7079-
ginkgo.By(fmt.Sprintf("Creating snapshot no: %d for pvc %s", i+1, pvclaim.Name))
7080-
volumeSnapshot, _, _, _, snapshotId, _, err := createDynamicVolumeSnapshot(ctx, namespace, snapc,
7081-
volumeSnapshotClass, pvclaim, volHandle, diskSize, true)
7082-
gomega.Expect(err).NotTo(gomega.HaveOccurred())
7083+
for i := 0; i < noOfSnapshotToCreate; i++ {
7084+
ginkgo.By(fmt.Sprintf("Creating snapshot no: %d for pvc %s", i+1, pvclaim.Name))
7085+
volumeSnapshot, _, _, _, snapshotId, _, err := createDynamicVolumeSnapshot(ctx, namespace, snapc,
7086+
volumeSnapshotClass, pvclaim, volHandle, diskSize, true)
7087+
gomega.Expect(err).NotTo(gomega.HaveOccurred())
70837088

7084-
volumeSnapshots = append(volumeSnapshots, volumeSnapshot)
7085-
snapshotIds = append(snapshotIds, snapshotId)
7086-
}
7089+
volumeSnapshots = append(volumeSnapshots, volumeSnapshot)
7090+
snapshotIds = append(snapshotIds, snapshotId)
7091+
}
70877092

7088-
defer func() {
7089-
if !snapDeleted {
7090-
for i := 0; i < noOfSnapshotToCreate; i++ {
7091-
ginkgo.By("Delete dynamic volume snapshot")
7092-
_, _, err = deleteVolumeSnapshot(ctx, snapc, namespace,
7093-
volumeSnapshots[i], pandoraSyncWaitTime, volHandle, snapshotIds[i], true)
7094-
gomega.Expect(err).NotTo(gomega.HaveOccurred())
7095-
}
7093+
defer func() {
7094+
if !snapDeleted {
7095+
for i := 0; i < noOfSnapshotToCreate; i++ {
7096+
ginkgo.By("Delete dynamic volume snapshot")
7097+
_, _, err = deleteVolumeSnapshot(ctx, snapc, namespace,
7098+
volumeSnapshots[i], pandoraSyncWaitTime, volHandle, snapshotIds[i], true)
7099+
gomega.Expect(err).NotTo(gomega.HaveOccurred())
70967100
}
7097-
}()
7098-
7099-
for i := 0; i < noOfSnapshotToCreate; i++ {
7100-
ginkgo.By("Delete dynamic volume snapshot")
7101-
_, _, err = deleteVolumeSnapshot(ctx, snapc, namespace,
7102-
volumeSnapshots[i], pandoraSyncWaitTime, volHandle, snapshotIds[i], true)
7103-
gomega.Expect(err).NotTo(gomega.HaveOccurred())
71047101
}
7105-
snapDeleted = true
7106-
})
7102+
}()
7103+
7104+
for i := 0; i < noOfSnapshotToCreate; i++ {
7105+
ginkgo.By("Delete dynamic volume snapshot")
7106+
_, _, err = deleteVolumeSnapshot(ctx, snapc, namespace,
7107+
volumeSnapshots[i], pandoraSyncWaitTime, volHandle, snapshotIds[i], true)
7108+
gomega.Expect(err).NotTo(gomega.HaveOccurred())
7109+
}
7110+
snapDeleted = true
7111+
})
71077112

71087113
/*
71097114

0 commit comments

Comments
 (0)