Skip to content

Commit

Permalink
Add error condition when notification replica is greater than 1
Browse files Browse the repository at this point in the history
Signed-off-by: Rizwana777 <[email protected]>
  • Loading branch information
Rizwana777 committed Jan 21, 2025
1 parent eace21c commit 4e9d634
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions controllers/argocd/argocd_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ func (r *ReconcileArgoCD) internalReconcile(ctx context.Context, request ctrl.Re
return reconcile.Result{}, argocd, err
}

// If the number of notification replicas is greater than 1, return an error
if argocd.Spec.Notifications.Replicas != nil && *argocd.Spec.Notifications.Replicas > 1 {
message := "Argo CD Notification controller does not support multiple replicas. Notification replicas cannot be greater than 1."
reqLogger.Info(message)
return reconcile.Result{}, argocd, fmt.Errorf("%s", message)
}

// Fetch labelSelector from r.LabelSelector (command-line option)
labelSelector, err := labels.Parse(r.LabelSelector)
if err != nil {
Expand Down

0 comments on commit 4e9d634

Please sign in to comment.