argoproj-labs / argocd-operator

A Kubernetes operator for managing Argo CD clusters.
https://argocd-operator.readthedocs.io
Apache License 2.0
659 stars 769 forks source link

fix the setting of environment variable ARGOCD_CONTROLLER_REPLICAS for dynamicScaling #1574

Closed ishitasequeira closed 1 month ago

ishitasequeira commented 1 month ago

What type of PR is this?

/kind bug

What does this PR do / why we need it:

Currently, when spec.controller.sharding.dynamicScalingEnabled feature is enabled on argocd-controller, we do not update the environment variable ARGOCD_CONTROLLER_REPLICAS with the correct number of replicas on the argocd-application-controller statefulset.

The PR fixes the logic of setting the number of replicas correctly in the environment variable of the statefulset pods.

Have you updated the necessary documentation?

Which issue(s) this PR fixes:

Fixes https://issues.redhat.com/browse/GITOPS-3465

How to test changes / Special notes to the reviewer: