From d890ef93917877953570e668322ff254d9f2c1e0 Mon Sep 17 00:00:00 2001 From: Ludovic Cleroux Date: Wed, 16 Oct 2024 16:47:25 +0200 Subject: [PATCH] ROX-26523: add test --- fleetshard/pkg/central/reconciler/reconciler_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fleetshard/pkg/central/reconciler/reconciler_test.go b/fleetshard/pkg/central/reconciler/reconciler_test.go index 166a8ebd6..553dff9c0 100644 --- a/fleetshard/pkg/central/reconciler/reconciler_test.go +++ b/fleetshard/pkg/central/reconciler/reconciler_test.go @@ -2773,3 +2773,10 @@ func TestArgoCDApplication_CanBeToggleOnAndOff(t *testing.T) { } } + +func Test_ReconcilerSetsArgoCDNamespaceLabel(t *testing.T) { + // We must set the "argocd.argoproj.io/managed-by" label on the namespace + // so that ArgoCD has the correct permissions to manage the resources in the namespace + r := CentralReconciler{openshiftGitopsNamespace: "foo"} + assert.Equal(t, "foo", r.getNamespaceLabels(private.ManagedCentral{})["argocd.argoproj.io/managed-by"]) +}