Repository navigation
🤖 feat: activate the CoderAIGatewayKey controller - #346
Conversation
Change-Id: I9e7b6f5ea04db940c6bd982d0a861a9a811ee0f6 Signed-off-by: Thomas Kosiewski <tk@coder.com>
Change-Id: Id9d090afd3e29026d578116a592057b1ab6f007a Signed-off-by: Thomas Kosiewski <tk@coder.com>
Change-Id: I32890aa15aec7a173c3da1edcb0731302f8b2cde Signed-off-by: Thomas Kosiewski <tk@coder.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex security review |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Change-Id: Idfe28ab7654a28103d15ae2e1a0faa806238c98f Signed-off-by: Thomas Kosiewski <tk@coder.com>
|
@codex review |
|
@codex security review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 812167e302
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
…er test Change-Id: If7ef13f439aac8f7de5c432cf7ba1f8f45613d38 Signed-off-by: Thomas Kosiewski <tk@coder.com>
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
G3 on the head 1a211c0CI full Kind E2E: run 38547828976, job 115799178542 passed in 480 s on this head. The full Kind steps ran, and the "Skip full E2E on pull requests" step was skipped. The first head, Image identity: I built the image from Setup: a Kind cluster (kindest/node v1.32.0) running Coder v2.37.2 (the CI image digest) with a Premium license.
Stuck finalizer, following the how-to as written (Coder scaled to 0, then the object deleted):
Leak scan: the operator log, all recordings and every Finding: namespace deletion leaves the keys in Coder (step 13). Kubernetes deletes the control plane and the
Environment notes (not code):
The video joins the six terminal recordings, rendered with idle gaps capped at 2 s, so waits look shorter than they were. k10-dogfood.mp4Generated with |
…ctivate Change-Id: If233f06bb871de790124f63b03f343998ab9ebc7 Signed-off-by: Thomas Kosiewski <tk@coder.com>
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |


K10 of #156: the operator now runs the
CoderAIGatewayKeycontroller, and the install bundle ships its CRD. This turns on AI Gateway key management in real installs, so it follows the activation rules of #315 (plan G3).K10a (#341) is on
main. I mergedmaininto this branch, so its diff is only the K10b change.What changes
controllerapp.SetupControllersregistersCoderAIGatewayKeyReconciler. It uses the manager's API reader for live reads of the output Secret and of the reserved-name sources, and the real clock.config/crd/dormant/toconfig/crd/bases/and intodist/install.yaml. The CI guard step for the dormant CRD is gone. The RBAC markers addget,list,watchandpatchoncoderaigatewaykeys(finalizer merge patch),getandupdateoncoderaigatewaykeys/status, andupdateoncoderaigatewaykeys/finalizers. There is noupdateon the object itself: the controller writes only its status. Thesecretsrule does not change (plan G2).allowKeysgate is live. The "no effect yet" sentences are gone fromspec.aiGatewayandAIGatewaySpec.allowKeys. The kind description now states the deletion delay, the retries and the no-control-plane case, instead of "revokes at once". The CRDs,dist/install.yamland the reference docs are regenerated.internal/controller/coderaigatewaykey*,owned_secret.goandreserved_secret_names.go.docs/how-to/manage-ai-gateway-keys.md(in the mkdocs nav), and a sample,config/samples/coder_v1alpha1_coderaigatewaykey.yaml. The index, deploy, architecture and getting-started pages name the new kind. The getting-started cleanup deletes keys before the control plane. The how-to covers:ControlPlaneGoneand the bounded pass;test-first JSON patch and then delete the keys by name;The K9 notes items (o) to (u)
CoderAIProviderdoes the same, the log names the key IDs, and a retry would delay the namespace deletion that the bounded pass exists for.Tests
TestSetupControllersStartsEveryController: a manager with every controller of the app starts against envtest, and its caches sync. This covers duplicate field indexes and served kinds. It runs serially, and its cache sees only an empty namespace of its own.TestCoderAIGatewayKeyAllowKeysGateon a live object: without the block,NotAllowedand zero Coder calls. Withfalse, the same. Withtrue,Ready. Back tofalsewith a new trigger,NotAllowed: no rotation, and the key stays in the Secret and in Coder. This replaces the K2-era wording ofTestControlPlaneAIGatewayAllowKeysLeavesDeploymentUnchanged. That test stays, because the field must still not roll the Coder Deployment.Size: about 350 changed lines without generated files (
dist/install.yaml, the CRDs,docs/reference/api/*). About 200 of them are the how-to.Local gates on the head:
make verify-vendor,make build,make lint,make test,make test-integration.go tool govulncheck ./....go test -race ./internal/controller/....make codegen,make build-installerandmake docs-referenceleave no drift.make docs-check(mkdocs build --strict), plus markdownlint-cli2 0.18.1 and cspell 8.19.4, as in the docs workflow.actionlintv1.7.10.The full Kind E2E run and the licensed dogfood run on this exact head are in the G3 evidence comment. Dogfood found one gap: a namespace deletion leaves the keys in Coder, because Kubernetes deletes the control plane at the same time. The how-to now warns about it and gives the cleanup. A controller-side fix is tracked in #353.
Refs #156
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$136.24