Skip to content

Commit

Permalink
fix(Apps in Any Namespace): Notification Controller Command
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur <[email protected]>
  • Loading branch information
ArthurVardevanyan committed Sep 16, 2024
1 parent 603adda commit b49b6ed
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions controllers/argocd/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"reflect"
"strings"
"time"

monitoringv1 "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1"
Expand Down Expand Up @@ -393,9 +394,6 @@ func (r *ReconcileArgoCD) reconcileNotificationsDeployment(cr *argoproj.ArgoCD,
"ALL",
},
},
SeccompProfile: &corev1.SeccompProfile{
Type: "RuntimeDefault",
},
},
VolumeMounts: []corev1.VolumeMount{
{
Expand Down Expand Up @@ -478,11 +476,6 @@ func (r *ReconcileArgoCD) reconcileNotificationsDeployment(cr *argoproj.ArgoCD,
deploymentChanged = true
}

if !reflect.DeepEqual(existingDeployment.Spec.Template.Spec.Containers[0].SecurityContext, desiredDeployment.Spec.Template.Spec.Containers[0].SecurityContext) {
existingDeployment.Spec.Template.Spec.Containers[0].SecurityContext = desiredDeployment.Spec.Template.Spec.Containers[0].SecurityContext
deploymentChanged = true
}

if !reflect.DeepEqual(existingDeployment.Spec.Template.Spec.ServiceAccountName, desiredDeployment.Spec.Template.Spec.ServiceAccountName) {
existingDeployment.Spec.Template.Spec.ServiceAccountName = desiredDeployment.Spec.Template.Spec.ServiceAccountName
deploymentChanged = true
Expand Down Expand Up @@ -619,6 +612,16 @@ func getNotificationsCommand(cr *argoproj.ArgoCD) []string {
cmd := make([]string, 0)
cmd = append(cmd, "argocd-notifications")

// This flag allows the notification controller to watch all namespaces
if cr.Spec.SourceNamespaces != nil && len(cr.Spec.SourceNamespaces) > 0 {
cmd = append(cmd, "--application-namespaces", fmt.Sprint(strings.Join(cr.Spec.SourceNamespaces, ",")))
}

// This flag allows the notification controller to watch
if cr.Spec.SourceNamespaces != nil && len(cr.Spec.SourceNamespaces) > 0 {
cmd = append(cmd, "--self-service-notification-enabled")
}

cmd = append(cmd, "--loglevel")
cmd = append(cmd, getLogLevel(cr.Spec.Notifications.LogLevel))

Expand Down

0 comments on commit b49b6ed

Please sign in to comment.