Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

fix: avoid trying to delete default namespace #265

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,3 +303,4 @@ kardinal flow telepresence-intercept {{flow-id}} {{service-name}} {{local-port}}
- Ask questions and get help in our community [forum](https://discuss.kardinal.dev).
- Read our [blog](https://blog.kardinal.dev/) for tips from developers and creators.


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
Loading