Skip to content

Commit f75e833

Browse files
authored
feat: deprecate dynamicScalingEnabled in ArgoCD CR (#2263)
* feat: deprecate dynamicScalingEnabled in ArgoCD CR Assisted-by: Cursor Signed-off-by: nmirasch <neus.miras@gmail.com> * Update bundle CRDs and fix staticcheck for dynamicScalingEnabled deprecation Assisted-by: Cursor Signed-off-by: nmirasch <neus.miras@gmail.com> --------- Signed-off-by: nmirasch <neus.miras@gmail.com>
1 parent c215f93 commit f75e833

10 files changed

Lines changed: 39 additions & 25 deletions

File tree

api/v1alpha1/argocd_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ type ArgoCDApplicationControllerShardSpec struct {
122122
// Replicas defines the number of replicas to run in the Application controller shard.
123123
Replicas int32 `json:"replicas,omitempty"`
124124

125-
// DynamicScalingEnabled defines whether dynamic scaling should be enabled for Application Controller component
125+
// Deprecated: dynamicScalingEnabled is deprecated and will be removed in a future release.
126+
// DynamicScalingEnabled defines whether dynamic scaling should be enabled for Application Controller component.
126127
DynamicScalingEnabled *bool `json:"dynamicScalingEnabled,omitempty"`
127128

128129
// MinShards defines the minimum number of shards at any given point

api/v1beta1/argocd_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ type ArgoCDApplicationControllerShardSpec struct {
155155
// Replicas defines the number of replicas to run in the Application controller shard.
156156
Replicas int32 `json:"replicas,omitempty"`
157157

158-
// DynamicScalingEnabled defines whether dynamic scaling should be enabled for Application Controller component
158+
// Deprecated: dynamicScalingEnabled is deprecated and will be removed in a future release.
159+
// DynamicScalingEnabled defines whether dynamic scaling should be enabled for Application Controller component.
159160
DynamicScalingEnabled *bool `json:"dynamicScalingEnabled,omitempty"`
160161

161162
// MinShards defines the minimum number of shards at any given point

bundle/manifests/argocd-operator.clusterserviceversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ metadata:
257257
capabilities: Deep Insights
258258
categories: Integration & Delivery
259259
certified: "false"
260-
createdAt: "2026-06-02T12:28:46Z"
260+
createdAt: "2026-06-30T07:22:31Z"
261261
description: Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes.
262262
operators.operatorframework.io/builder: operator-sdk-v1.35.0
263263
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4

bundle/manifests/argoproj.io_argocds.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,8 +1386,9 @@ spec:
13861386
minimum: 1
13871387
type: integer
13881388
dynamicScalingEnabled:
1389-
description: DynamicScalingEnabled defines whether dynamic
1390-
scaling should be enabled for Application Controller component
1389+
description: |-
1390+
Deprecated: dynamicScalingEnabled is deprecated and will be removed in a future release.
1391+
DynamicScalingEnabled defines whether dynamic scaling should be enabled for Application Controller component.
13911392
type: boolean
13921393
enabled:
13931394
description: Enabled defines whether sharding should be enabled
@@ -14243,8 +14244,9 @@ spec:
1424314244
minimum: 1
1424414245
type: integer
1424514246
dynamicScalingEnabled:
14246-
description: DynamicScalingEnabled defines whether dynamic
14247-
scaling should be enabled for Application Controller component
14247+
description: |-
14248+
Deprecated: dynamicScalingEnabled is deprecated and will be removed in a future release.
14249+
DynamicScalingEnabled defines whether dynamic scaling should be enabled for Application Controller component.
1424814250
type: boolean
1424914251
enabled:
1425014252
description: Enabled defines whether sharding should be enabled

config/crd/bases/argoproj.io_argocds.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,8 +1375,9 @@ spec:
13751375
minimum: 1
13761376
type: integer
13771377
dynamicScalingEnabled:
1378-
description: DynamicScalingEnabled defines whether dynamic
1379-
scaling should be enabled for Application Controller component
1378+
description: |-
1379+
Deprecated: dynamicScalingEnabled is deprecated and will be removed in a future release.
1380+
DynamicScalingEnabled defines whether dynamic scaling should be enabled for Application Controller component.
13801381
type: boolean
13811382
enabled:
13821383
description: Enabled defines whether sharding should be enabled
@@ -14232,8 +14233,9 @@ spec:
1423214233
minimum: 1
1423314234
type: integer
1423414235
dynamicScalingEnabled:
14235-
description: DynamicScalingEnabled defines whether dynamic
14236-
scaling should be enabled for Application Controller component
14236+
description: |-
14237+
Deprecated: dynamicScalingEnabled is deprecated and will be removed in a future release.
14238+
DynamicScalingEnabled defines whether dynamic scaling should be enabled for Application Controller component.
1423714239
type: boolean
1423814240
enabled:
1423914241
description: Enabled defines whether sharding should be enabled

controllers/argocd/statefulset.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,8 @@ func getArgoControllerContainerEnv(cr *argoproj.ArgoCD, replicas int32) []corev1
563563
Value: "/home/argocd",
564564
})
565565

566-
if cr.Spec.Controller.Sharding.Enabled || (cr.Spec.Controller.Sharding.DynamicScalingEnabled != nil && *cr.Spec.Controller.Sharding.DynamicScalingEnabled) {
566+
//lint:ignore SA1019 known to be deprecated
567+
if cr.Spec.Controller.Sharding.Enabled || (cr.Spec.Controller.Sharding.DynamicScalingEnabled != nil && *cr.Spec.Controller.Sharding.DynamicScalingEnabled) { //nolint:staticcheck // SA1019: honor deprecated field for backward compatibility
567568
env = append(env, corev1.EnvVar{
568569
Name: "ARGOCD_CONTROLLER_REPLICAS",
569570
Value: fmt.Sprint(replicas),
@@ -619,7 +620,8 @@ func (r *ReconcileArgoCD) getApplicationControllerReplicaCount(cr *argoproj.Argo
619620
var minShards = cr.Spec.Controller.Sharding.MinShards
620621
var maxShards = cr.Spec.Controller.Sharding.MaxShards
621622

622-
if cr.Spec.Controller.Sharding.DynamicScalingEnabled != nil && *cr.Spec.Controller.Sharding.DynamicScalingEnabled {
623+
//lint:ignore SA1019 known to be deprecated
624+
if cr.Spec.Controller.Sharding.DynamicScalingEnabled != nil && *cr.Spec.Controller.Sharding.DynamicScalingEnabled { //nolint:staticcheck // SA1019: honor deprecated field for backward compatibility
623625

624626
// TODO: add the same validations to Validation Webhook once webhook has been introduced
625627
if minShards < 1 {

controllers/argocd/statefulset_test.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ func TestReconcileArgoCD_reconcileApplicationController_withSharding(t *testing.
550550
},
551551
{
552552
sharding: argoproj.ArgoCDApplicationControllerShardSpec{
553+
//nolint:staticcheck // SA1019: honor deprecated field for backward compatibility
553554
DynamicScalingEnabled: boolPtr(true),
554555
MinShards: 2,
555556
MaxShards: 4,
@@ -822,8 +823,9 @@ func TestReconcileArgoCD_reconcileApplicationController_withDynamicSharding(t *t
822823
}{
823824
{
824825
sharding: argoproj.ArgoCDApplicationControllerShardSpec{
825-
Enabled: false,
826-
Replicas: 1,
826+
Enabled: false,
827+
Replicas: 1,
828+
//nolint:staticcheck // SA1019: honor deprecated field for backward compatibility
827829
DynamicScalingEnabled: boolPtr(true),
828830
MinShards: 2,
829831
MaxShards: 4,
@@ -834,8 +836,9 @@ func TestReconcileArgoCD_reconcileApplicationController_withDynamicSharding(t *t
834836
{
835837
// Replicas less than minimum shards
836838
sharding: argoproj.ArgoCDApplicationControllerShardSpec{
837-
Enabled: false,
838-
Replicas: 1,
839+
Enabled: false,
840+
Replicas: 1,
841+
//nolint:staticcheck // SA1019: honor deprecated field for backward compatibility
839842
DynamicScalingEnabled: boolPtr(true),
840843
MinShards: 1,
841844
MaxShards: 4,
@@ -846,8 +849,9 @@ func TestReconcileArgoCD_reconcileApplicationController_withDynamicSharding(t *t
846849
{
847850
// Replicas more than maximum shards
848851
sharding: argoproj.ArgoCDApplicationControllerShardSpec{
849-
Enabled: false,
850-
Replicas: 1,
852+
Enabled: false,
853+
Replicas: 1,
854+
//nolint:staticcheck // SA1019: honor deprecated field for backward compatibility
851855
DynamicScalingEnabled: boolPtr(true),
852856
MinShards: 1,
853857
MaxShards: 2,

deploy/olm-catalog/argocd-operator/0.19.0/argocd-operator.v0.19.0.clusterserviceversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ metadata:
257257
capabilities: Deep Insights
258258
categories: Integration & Delivery
259259
certified: "false"
260-
createdAt: "2026-06-02T12:28:46Z"
260+
createdAt: "2026-06-30T07:22:31Z"
261261
description: Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes.
262262
operators.operatorframework.io/builder: operator-sdk-v1.35.0
263263
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4

deploy/olm-catalog/argocd-operator/0.19.0/argoproj.io_argocds.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,8 +1386,9 @@ spec:
13861386
minimum: 1
13871387
type: integer
13881388
dynamicScalingEnabled:
1389-
description: DynamicScalingEnabled defines whether dynamic
1390-
scaling should be enabled for Application Controller component
1389+
description: |-
1390+
Deprecated: dynamicScalingEnabled is deprecated and will be removed in a future release.
1391+
DynamicScalingEnabled defines whether dynamic scaling should be enabled for Application Controller component.
13911392
type: boolean
13921393
enabled:
13931394
description: Enabled defines whether sharding should be enabled
@@ -14243,8 +14244,9 @@ spec:
1424314244
minimum: 1
1424414245
type: integer
1424514246
dynamicScalingEnabled:
14246-
description: DynamicScalingEnabled defines whether dynamic
14247-
scaling should be enabled for Application Controller component
14247+
description: |-
14248+
Deprecated: dynamicScalingEnabled is deprecated and will be removed in a future release.
14249+
DynamicScalingEnabled defines whether dynamic scaling should be enabled for Application Controller component.
1424814250
type: boolean
1424914251
enabled:
1425014252
description: Enabled defines whether sharding should be enabled

docs/reference/argocd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ AppSync | 3m | AppSync is used to control the sync frequency of ArgoCD Applicati
175175
Sharding.enabled | false | Whether to enable sharding on the ArgoCD Application Controller component. Useful when managing a large number of clusters to relieve memory pressure on the controller component. | |
176176
Sharding.replicas | 1 | The number of replicas that will be used to support sharding of the ArgoCD Application Controller. | Must be greater than 0 |
177177
Env | [Empty] | Environment to set for the application controller workloads | |
178-
Sharding.dynamicScalingEnabled | true | Whether to enable dynamic scaling of the ArgoCD Application Controller component. This will ignore the configuration of `Sharding.enabled` and `Sharding.replicas` | |
178+
Sharding.dynamicScalingEnabled | true | **Deprecated**Whether to enable dynamic scaling of the ArgoCD Application Controller component. This will ignore the configuration of `Sharding.enabled` and `Sharding.replicas` | |
179179
Sharding.minShards | 1 | The minimum number of replicas of the ArgoCD Application Controller component. | Must be greater than 0 |
180180
Sharding.maxShards | 1 | The maximum number of replicas of the ArgoCD Application Controller component. | Must be greater than `Sharding.minShards` |
181181
Sharding.clustersPerShard | 1 | The number of clusters that need to be handles by each shard. In case the replica count has reached the maxShards, the shards will manage more than one cluster. | Must be greater than 0 |

0 commit comments

Comments
 (0)