From 686d4bce34432adc5d5d2e43b134f3154fdd6c5d Mon Sep 17 00:00:00 2001 From: Arthur Date: Tue, 17 Sep 2024 16:48:45 +0000 Subject: [PATCH] fix(Apps in Any Namespace): Notification Controller Command Signed-off-by: Arthur --- controllers/argocd/notifications.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/controllers/argocd/notifications.go b/controllers/argocd/notifications.go index 174315e06..a44257745 100644 --- a/controllers/argocd/notifications.go +++ b/controllers/argocd/notifications.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "reflect" + "strings" "time" monitoringv1 "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1" @@ -628,6 +629,16 @@ func getNotificationsCommand(cr *argoproj.ArgoCD) []string { log.Info("Repo Server is disabled. This would affect the functioning of Notification Controller.") } + // This flag allows the notification controller to watch + if len(cr.Spec.SourceNamespaces) > 0 { + cmd = append(cmd, "--self-service-notification-enabled") + } + + // This flag allows the notification controller to watch all namespaces + if len(cr.Spec.SourceNamespaces) > 0 { + cmd = append(cmd, "--application-namespaces", fmt.Sprint(strings.Join(cr.Spec.SourceNamespaces, ","))) + } + return cmd }