Skip to content

Commit

Permalink
e2e: Add e2e- prefix to test namespaces
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nirs authored and raghavendra-talur committed Dec 12, 2024
1 parent d9b0ebc commit 4563fb3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion e2e/test/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 4563fb3

Please sign in to comment.