mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Merge pull request #114217 from jingxu97/snapshotfix
Fix issues in volumesnapshot test for ephemeral storage
This commit is contained in:
commit
6577fd2203
@ -225,7 +225,8 @@ func (s *snapshottableTestSuite) DefineTests(driver storageframework.TestDriver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
restoredPod = StartInPodWithVolumeSource(ctx, cs, volSrc, restoredPVC.Namespace, "restored-pvc-tester", "sleep 300", config.ClientNodeSelection)
|
restoredPod = StartInPodWithVolumeSource(ctx, cs, volSrc, restoredPVC.Namespace, "restored-pvc-tester", "sleep 300", config.ClientNodeSelection)
|
||||||
ginkgo.DeferCleanup(StopPod, cs, restoredPod)
|
ginkgo.DeferCleanup(e2epod.DeletePodWithWait, cs, restoredPod)
|
||||||
|
|
||||||
framework.ExpectNoError(e2epod.WaitTimeoutForPodRunningInNamespace(cs, restoredPod.Name, restoredPod.Namespace, f.Timeouts.PodStartSlow))
|
framework.ExpectNoError(e2epod.WaitTimeoutForPodRunningInNamespace(cs, restoredPod.Name, restoredPod.Namespace, f.Timeouts.PodStartSlow))
|
||||||
if pattern.VolType != storageframework.GenericEphemeralVolume {
|
if pattern.VolType != storageframework.GenericEphemeralVolume {
|
||||||
commands := e2evolume.GenerateReadFileCmd(datapath)
|
commands := e2evolume.GenerateReadFileCmd(datapath)
|
||||||
@ -234,14 +235,16 @@ func (s *snapshottableTestSuite) DefineTests(driver storageframework.TestDriver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ginkgo.By("should delete the VolumeSnapshotContent according to its deletion policy")
|
ginkgo.By("should delete the VolumeSnapshotContent according to its deletion policy")
|
||||||
|
|
||||||
// Delete both Snapshot and restored Pod/PVC at the same time because different storage systems
|
// 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
|
// have different ordering of deletion. Some may require delete the restored PVC first before
|
||||||
// Snapshot deletion and some are opposite.
|
// Snapshot deletion and some are opposite.
|
||||||
err = storageutils.DeleteSnapshotWithoutWaiting(dc, vs.GetNamespace(), vs.GetName())
|
err = storageutils.DeleteSnapshotWithoutWaiting(dc, vs.GetNamespace(), vs.GetName())
|
||||||
framework.ExpectNoError(err)
|
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)
|
||||||
deleteVolumeSnapshot(f, dc, sr, pattern, vscontent)
|
deleteVolumeSnapshot(f, dc, sr, pattern, vscontent)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should check snapshot fields, check restore correctly works after modifying source data, check deletion (persistent)", func(ctx context.Context) {
|
ginkgo.It("should check snapshot fields, check restore correctly works after modifying source data, check deletion (persistent)", func(ctx context.Context) {
|
||||||
|
Loading…
Reference in New Issue
Block a user