fix(argo-cd): fix RBAC condition for shard-cm when dynamicClusterDistribution is enabled#3871
Open
Raj-glitch-max wants to merge 3 commits intoargoproj:mainfrom
Open
Conversation
added 3 commits
May 2, 2026 14:51
…is enabled Signed-off-by: Raj-glitch-max <[email protected]>
Signed-off-by: Raj-glitch-max <[email protected]>
…stribution Signed-off-by: Raj-glitch-max <[email protected]>
There was a problem hiding this comment.
Pull request overview
Fixes a Helm chart templating bug that prevented Argo CD’s application controller from receiving RBAC permissions to manage the shard mapping ConfigMap when controller.dynamicClusterDistribution is enabled.
Changes:
- Fix RBAC gating logic so shard ConfigMap permissions are granted whenever
controller.dynamicClusterDistributionis enabled. - Update CI values to explicitly test the standard install path (
createClusterRoles: true). - Document the RBAC implication in
values.yamland bump chart version + changelog entry.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
charts/argo-cd/templates/argocd-application-controller/role.yaml |
Removes incorrect createClusterRoles dependency so shard-cm Role rule is emitted when dynamic distribution is enabled. |
charts/argo-cd/ci/dynamic-sharding-values.yaml |
Ensures CI scenario covers the common default (createClusterRoles: true) while enabling dynamic sharding. |
charts/argo-cd/values.yaml |
Documents that enabling dynamic cluster distribution grants RBAC access to the shard mapping ConfigMap. |
charts/argo-cd/Chart.yaml |
Bumps chart version and adds an Artifact Hub changelog entry describing the fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
Fixes the RBAC condition in
charts/argo-cd/templates/argocd-application-controller/role.yamlthat preventedargocd-app-controller-shard-cmpermissions from being granted in standard installations.Root cause: The condition was:
{{- if and (not .Values.createClusterRoles) .Values.controller.dynamicClusterDistribution }}Since
createClusterRolesdefaults totrue,(not .Values.createClusterRoles)always evaluates tofalse, short-circuiting the entire block. The application controller never received permission to read or write the shard mapping ConfigMap, causing conflict retries and zombie controllers stuck atshard=-1.Fix: Change the condition to:
{{- if .Values.controller.dynamicClusterDistribution }}The shard-CM permission should be gated only on whether dynamic cluster distribution is enabled — it has no dependency on
createClusterRoles.Verification
Reproduced with
helm templatebefore the fix:After the fix:
Changes
role.yaml— fix the broken RBAC condition (1 line)ci/dynamic-sharding-values.yaml— addcreateClusterRoles: trueto actually test the standard install path in CIvalues.yaml— document that enablingdynamicClusterDistributiongrants shard-cm RBAC accessChart.yaml— version bump 9.5.11 → 9.5.12 + changelog entryRelated
Reported in argoproj/argo-cd#21181
Checklist