Skip to content

fix: Allow specifying name of resources in argocd namespace#6307

Open
TBeijen wants to merge 1 commit into
akuity:mainfrom
TBeijen:rbac-overwrite-fix
Open

fix: Allow specifying name of resources in argocd namespace#6307
TBeijen wants to merge 1 commit into
akuity:mainfrom
TBeijen:rbac-overwrite-fix

Conversation

@TBeijen
Copy link
Copy Markdown

@TBeijen TBeijen commented May 17, 2026

…espace

All pull requests must reference an existing issue with no blocking labels.
PRs that do not meet this requirement will be automatically closed. See the
Contributor Guide for details.

Issue Reference

Closes #6295

Description

This PR fixes the resource name clash that occurs when installing Kargo in the same namespace as Argo.

Rationale:

  • Although considered in the issue description, refrained from changing anything to the resources in Kargo namespace (the majority). Consistent hard-coded resource names remain 'as-is'
  • Opted for a mechanism that by default changes nothing to existing installations
  • Users now have the option to specify the resource names in Argo. This is a niche use-case. If done so, chart will replace the role and rolebinding by counterparts with a different name. A quick and non-destructive change.

Rebased on v1.10.4 to properly test (couldn't find helm chart e2e tests). See comment.

Checklist

  • The PR is linked to an existing issue.
  • The linked issue has no blocking labels (kind/proposal,
    needs discussion, needs research, maintainer only, area/security,
    size/large, size/x-large, size/xx-large).
  • I have added or updated tests as appropriate.
  • I have added or updated documentation as appropriate.

AI Use Disclosure

Select one:

  • This PR was written by a human without AI assistance.
  • This PR was written by a human with AI assistance. A human has reviewed every line prior to opening the PR.
  • This PR was written by an AI with human supervision. A human has reviewed every line prior to opening the PR.
  • This PR was written entirely by AI. No human has reviewed this prior to opening the PR.

Sign-Off

  • All commits are signed off (git commit -s) (required)
  • All commits are cryptographically signed (git commit -S) (encouraged)

@TBeijen TBeijen requested a review from a team as a code owner May 17, 2026 06:19
@netlify
Copy link
Copy Markdown

netlify Bot commented May 17, 2026

Deploy Preview for docs-kargo-io ready!

Name Link
🔨 Latest commit 438f1f7
🔍 Latest deploy log https://app.netlify.com/projects/docs-kargo-io/deploys/6a0968dbef77070008971629
😎 Deploy Preview https://deploy-preview-6307.docs.kargo.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kargo-governance-bot kargo-governance-bot Bot added kind/bug Something isn't working as intended; If unsure that something IS a bug, start a discussion instead needs/area Issue or PR needs to be labeled to indicate what parts of the code base are affected needs/priority Priority has not yet been determined; a good signal that maintainers aren't fully committed labels May 17, 2026
@TBeijen TBeijen force-pushed the rbac-overwrite-fix branch from c6cd7b3 to 2a6c1f7 Compare May 17, 2026 06:21
@TBeijen TBeijen changed the title Ability to specify role & rolebinding name of resources in argocd nam… fix: Allow specifying name of resources in argocd namespace May 17, 2026
@TBeijen TBeijen force-pushed the rbac-overwrite-fix branch from 2a6c1f7 to 14de11e Compare May 17, 2026 06:53
@TBeijen TBeijen requested a review from a team as a code owner May 17, 2026 06:53
@TBeijen
Copy link
Copy Markdown
Author

TBeijen commented May 17, 2026

Note: Tests done with fix applied to v1.10.4. PR takes latest main since otherwise containing a bunch of merge conflicts.

Testing:

git checkout v1.10.4
helm -n gitops template ./charts/kargo \
  --set api.adminAccount.enabled=false \
  --set controller.argocd.watchArgocdNamespaceOnly=true \
  --set controller.argocd.namespace=gitops > render-v1.10.4.yaml

git checkout rbac-overwrite-fix
helm -n gitops template ./charts/kargo \
  --set api.adminAccount.enabled=false \
  --set controller.argocd.watchArgocdNamespaceOnly=true \
  --set controller.argocd.namespace=gitops > render-rbac-fix.yaml

helm -n gitops template ./charts/kargo \
  --set api.adminAccount.enabled=false \
  --set controller.argocd.watchArgocdNamespaceOnly=true \
  --set controller.argocd.resourceName=argo-kargo-controller \
  --set controller.argocd.namespace=gitops > render-rbac-fix-resource-name.yaml

Results:

diff render-v1.10.4.yaml render-rbac-fix.yaml
# Nothing (good, no regression introduced)

diff render-rbac-fix.yaml render-rbac-fix-resource-name.yaml -u
# Gives:
--- render-rbac-fix.yaml        2026-05-17 08:53:39
+++ render-rbac-fix-resource-name.yaml  2026-05-17 08:53:48
@@ -7437,7 +7437,7 @@
 apiVersion: rbac.authorization.k8s.io/v1
 kind: Role
 metadata:
-  name: kargo-controller
+  name: argo-kargo-controller
   namespace: gitops
   labels:
     helm.sh/chart: kargo-0.1.0
@@ -7654,7 +7654,7 @@
 apiVersion: rbac.authorization.k8s.io/v1
 kind: RoleBinding
 metadata:
-  name: kargo-controller
+  name: argo-kargo-controller
   namespace: gitops
   labels:
     helm.sh/chart: kargo-0.1.0
@@ -7666,7 +7666,7 @@
 roleRef:
   apiGroup: rbac.authorization.k8s.io
   kind: Role
-  name: kargo-controller
+  name: argo-kargo-controller
 subjects:
 - kind: ServiceAccount
   namespace: gitops

@TBeijen TBeijen force-pushed the rbac-overwrite-fix branch from 14de11e to 4fa20b4 Compare May 17, 2026 06:58
…espace

Signed-off-by: Tibo Beijen <tibobeijen@gmail.com>
@TBeijen TBeijen force-pushed the rbac-overwrite-fix branch from 4fa20b4 to 438f1f7 Compare May 17, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working as intended; If unsure that something IS a bug, start a discussion instead needs/area Issue or PR needs to be labeled to indicate what parts of the code base are affected needs/priority Priority has not yet been determined; a good signal that maintainers aren't fully committed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Helm chart v1.10.4: Role name collision between controller/roles.yaml and argocd/role.yaml

1 participant