🤖 Operator token record: residual limits after #428

Aperta
#432 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
go, kubernetes
Ambito
backend, databases

Direzione di ricerca

Read PR #428 and the linked discussion threads for each item to locate the reconcile code writing status.operatorAccessReady and operatorTokenSecretRef. Check docs/how-to/deploy-controller.md for the hash/URL item. Done means each listed residual limit is fixed with live readiness writes and a recorded database identity.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Follow-ups that PR #428 (fix for #406) leaves open. Each one needs more than a small change in the operator token record, so #428 documents it or leaves it here.

  1. Readiness during a database change. When a ready control plane moves to a database with another hash, status.operatorAccessReady stays true, with the old status.operatorTokenSecretRef, until the final status write of that reconcile. This matches main. During that window, consumers send the old token to the new database and get 401s at the control plane origin. No token goes to another origin. A fix sets readiness to false in the record write before the create. It also needs a live write that restores readiness, because the final status write merges only the fields that changed against the first read of the reconcile. Codex thread: https://github.com/coder/coder-k8s/pull/428#discussion_r4429874209
  2. Secret rename on a record from an earlier version. When an upgraded control plane has a record without status.operatorTokenID and spec.operatorAccess.generatedTokenSecretName changes, the rotation deletes the old token and writes the new one only to the renamed Secret. If the final status write fails, or the controller stops, status still names the old Secret with operatorAccessReady=true, so consumers get 401s until the next reconcile. This matches main, where a rename also always rotates because the renamed Secret is empty. The fix is the same live readiness write as item 1. Codex thread: https://github.com/coder/coder-k8s/pull/428#discussion_r4430006050
  3. One record per control plane. When a control plane that owns its Secret moves to another database, the controller records the new database before it provisions there. It then no longer deletes a token in the earlier database. main also forgot that token. Keeping the old record would block operator access after every URL change. A fix needs a second record (a status field) and a way to reach the old database.
  4. The hash names a URL, not a server (#406 item 5, documented in docs/how-to/deploy-controller.md). A sound fix records a database identity read from the server, for example Coder's deployment ID, and checks it inside the delete transaction.
  5. --cascade=orphan (#406 item 3, documented). Readers cannot tell an orphaned Secret from a replaced one without a record of the Secret's UID.

Not in scope here: a record from a create that failed before its commit no longer authorizes a delete by name. #428 fixes that case with status.operatorTokenID.

Trigger: the next change to operator access, or a report of a token that stayed valid or was deleted in the wrong database.

Refs #406, #428


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

Lingua principale
Go
Stelle
5
Fork
3
Merge medio
2h 49m
PR unite (30g)
206

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di coder/coder-k8s

Tutte le issue di coder/coder-k8s

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.