From e410ad05193ab17361fa35c8b756f9173bc6a074 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 46b854ab4..8bfdafac0 100644 --- a/e2e/test/context.go +++ b/e2e/test/context.go @@ -14,6 +14,9 @@ import ( "go.uber.org/zap" ) +// Make it eaisr to manage namespaces created by the tests. +const namespacePrefix = "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 namespacePrefix + c.name } func (c *Context) Logger() *zap.SugaredLogger {