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

未關閉
#1,558 0 則留言 0 個 reaction 已指派 1 人 在 GitHub 檢視

維護者通常 1 天內回覆

@Rizwana777 已經在處理了。

開始於 2026年11月16日。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
45/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
go, kubernetes

研究方向

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.

由索引模型根據 Issue 內容生成。

描述

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)

主要語言
Go
星號
190
分支
367
平均合併
4 天 2 小時
30 天內合併 PR
63

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

redhat-developer/gitops-operator 的其他 Issue

查看 redhat-developer/gitops-operator 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。