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

Ouverte
#1,558 0 commentaires 0 réactions 1 personne assignée Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@Rizwana777 y travaille déjà.

Depuis le 16/11/2026.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
45/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
go, kubernetes

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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)

Langage dominant
Go
Étoiles
190
Forks
367
Merge moyen
4 j 2 h
PR mergées (30 j)
63

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de redhat-developer/gitops-operator

Toutes les issues de redhat-developer/gitops-operator

Issues similaires

Plus d'issues Go

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.