From 69b9cf5ccca6925d626e8a9b76487204a9ed36a3 Mon Sep 17 00:00:00 2001 From: Masaki Kimura Date: Thu, 30 Aug 2018 15:11:27 +0000 Subject: [PATCH] Fix subpath tests not to fail in namespace deletion This commit fixes below subpath test not to fail in namespace deletion - subPath should support restarting containers using directory as subpath - subPath should support restarting containers using file as subpath Fixes: #68073 --- test/e2e/storage/testsuites/subpath.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/e2e/storage/testsuites/subpath.go b/test/e2e/storage/testsuites/subpath.go index ade96f60ee..166c13b4d7 100644 --- a/test/e2e/storage/testsuites/subpath.go +++ b/test/e2e/storage/testsuites/subpath.go @@ -589,7 +589,9 @@ func testPodContainerRestart(f *framework.Framework, pod *v1.Pod) { By(fmt.Sprintf("Creating pod %s", pod.Name)) pod, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Create(pod) Expect(err).ToNot(HaveOccurred(), "while creating pod") - + defer func() { + framework.DeletePodWithWait(f, f.ClientSet, pod) + }() err = framework.WaitForPodRunningInNamespace(f.ClientSet, pod) Expect(err).ToNot(HaveOccurred(), "while waiting for pod to be running")