Deleting an ArgoCD instance removes RBAC belonging to same-named instances

Aperta
#1,558 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Rizwana777 ci sta già lavorando.

Dal 16/11/2026.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, kubernetes

Direzione di ricerca

Start in argocd-operator/controllers/argocd/util.go, at deleteClusterResources (around line 755) and argocdInstanceSelector (around line 849), then follow the deletion path called from argocd_controller.go around line 264. Reproduce with a fake-client test that runs Reconcile on two same-named ArgoCD CRs in different namespaces. Done when deleting the tenant CR removes only its own ClusterRoles, ClusterRoleBindings and RoleBindings, and the victim's RBAC survives. Check that the owner match includes namespace, and ideally UID, before settling on the approach.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

kind/bug

With a cluster-wide operator installation, a user who can create and delete ArgoCD CRs in their own namespace can cause the operator to delete another instance's RBAC by reusing its CR name. No permissions in the victim namespace are required.

Reproduction

  1. Have an existing cluster-scoped ArgoCD instance named shared-name in namespace victim.
  2. Create another ArgoCD CR named shared-name in an unrelated namespace, tenant.
  3. Wait for the operator to add its deletion finalizer, then delete the tenant CR.

Actual behavior

deleteClusterResources selects resources using only app.kubernetes.io/managed-by=<CR name>, without checking the owning namespace. Cleanup deletes matching ClusterRoles, ClusterRoleBindings, and RoleBindings belonging to the victim instance, disrupting its operation. Repeating the creation/deletion cycle can repeatedly remove the victim's RBAC.

Relevant code: argocd-operator/controllers/argocd/util.go, particularly deleteClusterResources at line 755 and argocdInstanceSelector at line 849. The deletion reconciliation path calls this cleanup from argocd_controller.go:264.

Expected behavior

Deleting an ArgoCD instance should remove only resources owned by that instance. Cleanup should verify the complete owning CR identity, including namespace and preferably UID. Add regression coverage with same-named instances in different namespaces, ensuring deletion removes the tenant's resources while preserving the victim's.

Confirmed at commit 5fb7a030 using an isolated fake-client reproduction through Reconcile; no live-cluster exploit was run.

(Bug text c/o OpenAI Codex v6.1 Sol xhigh)

Lingua principale
Go
Stelle
190
Fork
367
Merge medio
4g 2h
PR unite (30g)
63

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di redhat-developer/gitops-operator

Tutte le issue di redhat-developer/gitops-operator

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.