From d030c64743b3ed9cf2a0b8feefe2314207ea1fa0 Mon Sep 17 00:00:00 2001 From: Jiawei Wang Date: Mon, 10 Aug 2020 18:02:19 -0700 Subject: [PATCH] [e2e]Bind csi driver namespace to test namespace to avoid namespace collision --- test/e2e/storage/utils/utils.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/e2e/storage/utils/utils.go b/test/e2e/storage/utils/utils.go index e081a7e1d2c..e6ac7027b30 100644 --- a/test/e2e/storage/utils/utils.go +++ b/test/e2e/storage/utils/utils.go @@ -709,9 +709,11 @@ func FindVolumeGlobalMountPoints(hostExec HostExec, node *v1.Node) sets.String { // CreateDriverNamespace creates a namespace for CSI driver installation. // The namespace is still tracked and ensured that gets deleted when test terminates. func CreateDriverNamespace(f *framework.Framework) *v1.Namespace { - ginkgo.By(fmt.Sprintf("Building a driver namespace object, basename %s", f.BaseName)) - namespace, err := f.CreateNamespace(f.BaseName, map[string]string{ - "e2e-framework": f.BaseName, + ginkgo.By(fmt.Sprintf("Building a driver namespace object, basename %s", f.Namespace.Name)) + // The driver namespace will be bound to the test namespace in the prefix + namespace, err := f.CreateNamespace(f.Namespace.Name, map[string]string{ + "e2e-framework": f.BaseName, + "e2e-test-namespace": f.Namespace.Name, }) framework.ExpectNoError(err)