From 04d184c4d97b90fa6167b8854967d4558853df8b Mon Sep 17 00:00:00 2001 From: Leandro Poroli Date: Wed, 2 Oct 2024 18:09:24 -0300 Subject: [PATCH 1/2] avoid trying to delete default namespace --- .../kardinal-manager/cluster_manager/cluster_manager.go | 7 +++++++ .../cluster_manager/cluster_manager_test.go | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/kardinal-manager/kardinal-manager/cluster_manager/cluster_manager.go b/kardinal-manager/kardinal-manager/cluster_manager/cluster_manager.go index dbccb32c..61063185 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 30777f38..ccd88deb 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) From 4aa0581885729dde5778e5638249d986201da826 Mon Sep 17 00:00:00 2001 From: Leandro Poroli Date: Wed, 2 Oct 2024 19:04:46 -0300 Subject: [PATCH 2/2] adding extra commit so release please can pick the changes from the PR title --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b2263424..e43bdc0c 100644 --- a/README.md +++ b/README.md @@ -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. +