NamespaceManagement revocation checks labels on the wrong namespace

Đang mở
#1,559 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Rizwana777 đang làm issue này rồi.

Từ ngày 16/11/2026.

  • #1563 của @atishay-kasliwal — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go, kubernetes
Lĩnh vực
authorization, security

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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)

Ngôn ngữ chính
Go
Star
190
Fork
367
Merge trung bình
4 ngày 2 giờ
Pull request đã merge (30 ngày)
63

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của redhat-developer/gitops-operator

Tất cả issue của redhat-developer/gitops-operator

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.