diff --git a/kardinal-manager/kardinal-manager/cluster_manager/cluster_manager.go b/kardinal-manager/kardinal-manager/cluster_manager/cluster_manager.go index dbccb32..6106318 100644 --- a/kardinal-manager/kardinal-manager/cluster_manager/cluster_manager.go +++ b/kardinal-manager/kardinal-manager/cluster_manager/cluster_manager.go @@ -34,6 +34,8 @@ const ( // TODO move these values to a shared library between Kardinal Manager, Kontrol and Kardinal CLI kardinalLabelKey = "kardinal.dev" enabledKardinal = "enabled" + + defaultNamespace = "default" ) var ( @@ -428,6 +430,11 @@ func (manager *ClusterManager) removeKardinalNamespaces(ctx context.Context) err } for _, namespace := range kardinalNamespaces.Items { + + if namespace.GetName() == defaultNamespace { + continue + } + if err := manager.removeNamespace(ctx, &namespace); err != nil { return stacktrace.Propagate(err, "an error occurred while removing Kardinal namespace '%s'", namespace.GetName()) } diff --git a/kardinal-manager/kardinal-manager/cluster_manager/cluster_manager_test.go b/kardinal-manager/kardinal-manager/cluster_manager/cluster_manager_test.go index 30777f3..ccd88de 100644 --- a/kardinal-manager/kardinal-manager/cluster_manager/cluster_manager_test.go +++ b/kardinal-manager/kardinal-manager/cluster_manager/cluster_manager_test.go @@ -7,10 +7,6 @@ import ( "testing" ) -const ( - defaultNamespace = "default" -) - func TestClusterManager_GetVirtualServices(t *testing.T) { ctx := context.Background() clusterManager, err := getClusterManagerForTesting(t)