From 4563fb3d3976624f11b64f81944c5e99e8dbddf0 Mon Sep 17 00:00:00 2001 From: Nir Soffer Date: Mon, 9 Dec 2024 16:22:17 +0200 Subject: [PATCH] e2e: Add e2e- prefix to test namespaces It it hard to manage the namespaces created for every test when they don't have a common prefix. Add "e2e-" prefix so all of them sort together when listing namespaces. Example namespaces during test: % kubectl get ns --context hub | grep e2e- e2e-subscr-deploy-cephfs-busybox Active 6m2s e2e-subscr-deploy-rbd-busybox Active 6m2s % kubectl get ns --context dr1 | grep e2e- e2e-disapp-deploy-rbd-busybox Active 4m49s e2e-subscr-deploy-cephfs-busybox Active 4m14s e2e-subscr-deploy-rbd-busybox Active 4m48s % kubectl get ns --context dr2 | grep e2e- e2e-disapp-deploy-rbd-busybox Active 5m10s e2e-subscr-deploy-cephfs-busybox Active 5m8s e2e-subscr-deploy-rbd-busybox Active 4m35s Fixes: #1611 Signed-off-by: Nir Soffer --- e2e/test/context.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/e2e/test/context.go b/e2e/test/context.go index e520602ec..a32c066ff 100644 --- a/e2e/test/context.go +++ b/e2e/test/context.go @@ -14,6 +14,9 @@ import ( "go.uber.org/zap" ) +// Make it easier to manage namespaces created by the tests. +const appNamespacePrefix = "e2e-" + type Context struct { workload types.Workload deployer types.Deployer @@ -53,7 +56,7 @@ func (c *Context) ManagementNamespace() string { } func (c *Context) AppNamespace() string { - return c.name + return appNamespacePrefix + c.name } func (c *Context) Logger() *zap.SugaredLogger {