CoderWorkspacePool: count bound and used members only when their owner matches the pool's owner

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

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

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
62/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
infrastructure

Hướng nghiên cứu

Start in countPoolMembers in internal/controller/coderworkspacepool_controller.go (around lines 767-780) and find where the pool's resolved owner ID is computed so you can compare against it. Only increment the bound and used counts when a member's spec.ownerID matches that owner. Done when a foreign-owner bound member no longer changes boundReplicas or usedReplicas, and an envtest covering that case passes.

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

Mô tả

Problem

The pool counts a bound or used member toward its bound and used counts without checking that the member's spec.ownerID matches the pool's resolved owner. countPoolMembers (internal/controller/coderworkspacepool_controller.go:767-780) increments both counts before it checks any owner ID.

The #153 plan lists this as optional hardening (section 16, item 777(c) of the #357 final assessor items). The #463 round-2 verifier found it unimplemented and untracked.

Impact

Low. Users have read-only RBAC on members (threat T4), so only the operator or a cluster admin can create a member whose owner differs from its pool. Such a member can skew readyReplicas, boundReplicas or usedReplicas and the replacement decisions that use them.

Fix

Count a bound or used member only when its spec.ownerID equals the pool's resolved owner ID. Add an envtest with a foreign-owner bound member.

Refs #153.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

Ngôn ngữ chính
Go
Star
5
Fork
3
Merge trung bình
2 giờ 49 phút
Pull request đã merge (30 ngày)
206

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 coder/coder-k8s

Tất cả issue của coder/coder-k8s

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.