NamespaceManagement revocation checks labels on the wrong namespace

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

維護者通常 1 天內回覆

@Rizwana777 已經在處理了。

開始於 2026年11月16日。

  • #1563 來自 @atishay-kasliwal —— 未關閉

評估

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

研究方向

Start in argocd-operator/controllers/argocd/util.go at handleNamespaceManagementDelete and handleNamespaceManagementUpdate, where the cleanup fetches the namespace named by .spec.managedBy instead of the CR's own namespace. Reproduce the deletion case with the fake client first. Done when the target namespace's labels decide whether the old manager's Roles and RoleBindings are revoked, with regression tests for deletion, retargeting, and a preserved valid target-label grant.

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

描述

kind/bug

Deleting or redirecting a NamespaceManagement CR can leave the old ArgoCD instance's cross-namespace permissions in place. The cleanup checks the managing namespace's labels instead of the namespace withdrawing consent.

Reproduction

With ALLOW_NAMESPACE_MANAGEMENT_IN_NAMESPACE_SCOPED_INSTANCES=true:

  1. Create a namespace-scoped ArgoCD instance in manager, with .spec.namespaceManagement: [{name: target, allowManagedBy: true}].
  2. Label namespace manager with argocd.argoproj.io/managed-by: manager. Leave namespace target without a managed-by label.
  3. Create a NamespaceManagement CR in target with .spec.managedBy: manager, and wait for the cross-namespace Roles and RoleBindings to be created.
  4. Delete that NamespaceManagement CR, or change its .spec.managedBy to another namespace.

Actual behavior

The cleanup handlers fetch namespace manager using .spec.managedBy. Its self-referencing managed-by label causes cleanup to be skipped, although target has no overlapping label grant. The old manager's Roles and RoleBindings remain in target, retaining access after consent is withdrawn.

Relevant code: argocd-operator/controllers/argocd/util.go, in handleNamespaceManagementUpdate at line 2026 and handleNamespaceManagementDelete at line 2048.

Expected behavior

Check the labels on the NamespaceManagement CR's own namespace (target). Revoke the old manager's grants unless that target namespace independently authorizes continued access. Add regression tests for deletion and retargeting with a self-labeled manager, plus a case preserving a valid target-namespace label grant.

Confirmed the deletion case at commit 5fb7a030 using an isolated fake-client reproduction after a prior grant; 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 摘要。