Skip to content

Commit

Permalink
avoid trying to delete default namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
leoporoli committed Oct 2, 2024
1 parent 44451c8 commit 04d184c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ import (
"testing"
)

const (
defaultNamespace = "default"
)

func TestClusterManager_GetVirtualServices(t *testing.T) {
ctx := context.Background()
clusterManager, err := getClusterManagerForTesting(t)
Expand Down

0 comments on commit 04d184c

Please sign in to comment.