Skip to content

Commit

Permalink
Merge pull request kubernetes#105153 from mauriciopoppe/automated-che…
Browse files Browse the repository at this point in the history
…rry-pick-of-#104634-upstream-release-1.21

Automated cherry pick of kubernetes#104634: storege e2etest: Delete restored PVC/Pod in snapshottable
  • Loading branch information
k8s-ci-robot authored Sep 22, 2021
2 parents eb84221 + 8fbca19 commit 401153d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/e2e/storage/testsuites/snapshottable.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,15 @@ func (s *snapshottableTestSuite) DefineTests(driver storageframework.TestDriver,

ginkgo.By("should delete the VolumeSnapshotContent according to its deletion policy")

// Delete both Snapshot and PVC at the same time because different storage systems
// have different ordering of deletion. Some may require delete PVC first before
// Delete both Snapshot and restored Pod/PVC at the same time because different storage systems
// have different ordering of deletion. Some may require delete the restored PVC first before
// Snapshot deletion and some are opposite.
err = storageutils.DeleteSnapshotWithoutWaiting(dc, vs.GetNamespace(), vs.GetName())
framework.ExpectNoError(err)
framework.Logf("deleting restored pod %q/%q", restoredPod.Namespace, restoredPod.Name)
err = cs.CoreV1().Pods(restoredPod.Namespace).Delete(context.TODO(), restoredPod.Name, metav1.DeleteOptions{})
framework.ExpectNoError(err)
framework.Logf("deleting restored PVC %q/%q", restoredPVC.Namespace, restoredPVC.Name)
err = cs.CoreV1().PersistentVolumeClaims(restoredPVC.Namespace).Delete(context.TODO(), restoredPVC.Name, metav1.DeleteOptions{})
framework.ExpectNoError(err)

Expand Down

0 comments on commit 401153d

Please sign in to comment.