Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Namespace deletion leaves AI Gateway keys and AI providers in Coder

Abierto
#353 4 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@ThomasK33 ya está trabajando en esto.

Desde el 14/10/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

Problem

When a namespace is deleted, Kubernetes deletes the CoderControlPlane and its CoderAIGatewayKey objects at the same time. The operator then cannot reach Coder: the control plane is gone, or its Coder pod is already down when the bounded pass runs. So it releases the finalizers without deleting the keys, and full-trust gateway keys stay valid in Coder. CoderAIProvider has the same gap for providers.

Seen in the dogfood run of #346 (see the G3 evidence comment, step 13):

  • The namespace was gone after 11 s.
  • The key row stayed in Coder's ai_gateway_keys table.
  • The operator logged Releasing the finalizer without deleting the keys in Coder with reason ControlPlaneGone and the key ID.

Today the how-to (docs/how-to/manage-ai-gateway-keys.md) warns about this and gives the cleanup: delete the key objects before the namespace, or delete the logged keys with coder ai-gateway keys delete.

Options

  1. A cluster-wide sweeper (plan risk RK7) that deletes ck8s-<uid>- keys whose UID no CoderAIGatewayKey has, after the settle window. The same idea works for providers.
  2. Hold the control plane's deletion (a finalizer or a deletion check) while dependent CoderAIGatewayKey and CoderAIProvider objects exist, so they are cleaned up first.

Related items to decide together

  • While the control plane is being deleted, a failed operator-access read releases at once without a retry (#156 plan, K9 notes item q). This is a second path that leaves keys.
  • The CoderAnswerMismatch gate is lost when the status write right after the mismatch fails (K9 notes item u). The settle window bounds this to one extra create, whose key the sweep deletes.
  • A metric or a Kubernetes Event for ControlPlaneGone releases. Today the log line is the only signal.

Refs #156


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

Lenguaje dominante
Go
Estrellas
5
Forks
3
Merge medio
3 h
PR fusionados (30 d)
192

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de coder/coder-k8s

Todos los issues de coder/coder-k8s

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.