Skip to content

Commit 2a00b74

Browse files
committed
Revert "make self-desctructing namespaces optional"
This reverts commit ffe3460. On-behalf-of: SAP <[email protected]> Signed-off-by: Simon Bein <[email protected]>
1 parent df3534e commit 2a00b74

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

test/e2e/frontproxies/frontproxies_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func TestCreateFrontProxy(t *testing.T) {
4545
ctx := context.Background()
4646
namespace := "create-frontproxy"
4747

48-
utils.CreateNamespace(t, ctx, client, namespace, true)
48+
utils.CreateSelfDestructingNamespace(t, ctx, client, namespace)
4949

5050
// deploy rootshard
5151
rootShard := utils.DeployRootShard(ctx, t, client, namespace)

test/e2e/rootshards/rootshards_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func TestCreateRootShard(t *testing.T) {
4141
ctx := context.Background()
4242
namespace := "create-rootshard"
4343

44-
utils.CreateNamespace(t, ctx, client, namespace, true)
44+
utils.CreateSelfDestructingNamespace(t, ctx, client, namespace)
4545
rootShard := utils.DeployRootShard(ctx, t, client, namespace)
4646

4747
configSecretName := "kubeconfig"

test/e2e/shards/shards_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func TestCreateShard(t *testing.T) {
4444

4545
// create namspace
4646
namespace := "create-shard"
47-
utils.CreateNamespace(t, ctx, client, namespace, true)
47+
utils.CreateSelfDestructingNamespace(t, ctx, client, namespace)
4848

4949
// deploy a root shard incl. etcd
5050
rootShard := utils.DeployRootShard(ctx, t, client, namespace)

test/utils/utils.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func GetKubeClient(t *testing.T) ctrlruntimeclient.Client {
7777
return c
7878
}
7979

80-
func CreateNamespace(t *testing.T, ctx context.Context, client ctrlruntimeclient.Client, name string, selfDestructing bool) {
80+
func CreateSelfDestructingNamespace(t *testing.T, ctx context.Context, client ctrlruntimeclient.Client, name string) {
8181
t.Helper()
8282

8383
ns := corev1.Namespace{}
@@ -88,14 +88,12 @@ func CreateNamespace(t *testing.T, ctx context.Context, client ctrlruntimeclient
8888
t.Fatal(err)
8989
}
9090

91-
if selfDestructing {
92-
t.Cleanup(func() {
93-
t.Logf("Deleting namespace %s…", name)
94-
if err := client.Delete(ctx, &ns); err != nil {
95-
t.Fatal(err)
96-
}
97-
})
98-
}
91+
t.Cleanup(func() {
92+
t.Logf("Deleting namespace %s…", name)
93+
if err := client.Delete(ctx, &ns); err != nil {
94+
t.Fatal(err)
95+
}
96+
})
9997
}
10098

10199
func SelfDestuctingPortForward(

0 commit comments

Comments
 (0)