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

Offen
#465 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
Ein halber Tag
Anfängerfreundlichkeit
62/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
go, kubernetes
Bereich
infrastructure

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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

Vorherrschende Sprache
Go
Sterne
5
Forks
3
Ø Merge
2 Std. 49 Min.
Gemergte PRs (30 T.)
206

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus coder/coder-k8s

Alle Issues in coder/coder-k8s

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.