From ccc3b4a41fdf63f99256918e96339d0a5834496f Mon Sep 17 00:00:00 2001 From: Thomas Kosiewski Date: Sat, 3 Oct 2026 15:31:03 +0000 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=A4=96=20docs:=20complete=20the=20Cod?= =?UTF-8?q?erTemplateTest=20how-to?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Expand the CoderTemplateTest how-to with a "Read the result" section that lists every status.reason the controller sets (waiting, failure, and WorkspaceDeleted condition reasons) with what to do, a ResourceQuota example to cap test count, and a nightly CronJob with the RBAC it needs. The existing notes on the tester, retain, TTL, keys, builds, and TLS stay as they were. Add troubleshooting entries for a test that stays Pending, a test that does not finish deleting (finalizer), and a namespace stuck Terminating because of the aggregated API LIST bug (#209). Add a sample manifest (validated with a server-side dry run against the CRD in envtest) and list CoderTemplateTest among the operator kinds in the README. Refs #152 Signed-off-by: Thomas Kosiewski --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_ Change-Id: I0af2782b45a458869b2a1840611682a600cf06a3 --- .cspell.json | 1 + README.md | 2 +- .../coder_v1alpha1_codertemplatetest.yaml | 26 ++++ docs/how-to/deploy-controller.md | 5 +- docs/how-to/test-templates.md | 147 ++++++++++++++++++ docs/how-to/troubleshooting.md | 50 ++++++ 6 files changed, 229 insertions(+), 2 deletions(-) create mode 100644 config/samples/coder_v1alpha1_codertemplatetest.yaml diff --git a/.cspell.json b/.cspell.json index 993f3b694..e1c202ec4 100644 --- a/.cspell.json +++ b/.cspell.json @@ -19,6 +19,7 @@ "rolebinding", "subresource", "subresources", + "finalizers", "configmap", "healthcheck", "ipairs", diff --git a/README.md b/README.md index 9da1622bd..067428cbe 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Use native Kubernetes APIs to run and manage [Coder](https://coder.com). | Component | Manages | API group | | --- | --- | --- | -| Operator | `CoderControlPlane`, `CoderProvisioner`, `CoderWorkspaceProxy` (custom resources) | `coder.com/v1alpha1` | +| Operator | `CoderControlPlane`, `CoderProvisioner`, `CoderTemplateTest`, `CoderWorkspaceProxy` (custom resources) | `coder.com/v1alpha1` | | Aggregated API server | `CoderWorkspace`, `CoderTemplate`, `CoderTemplateVersion` (served from a live Coder instance) | `aggregation.coder.com/v1alpha1` | | MCP server | Tools that inspect and operate these resources over HTTP | — | diff --git a/config/samples/coder_v1alpha1_codertemplatetest.yaml b/config/samples/coder_v1alpha1_codertemplatetest.yaml new file mode 100644 index 000000000..b23378e9b --- /dev/null +++ b/config/samples/coder_v1alpha1_codertemplatetest.yaml @@ -0,0 +1,26 @@ +# Tests one Coder template version: the controller creates a workspace from +# it, waits until every agent is ready, records the result, and deletes the +# workspace. See docs/how-to/test-templates.md. +# +# Prerequisites: +# - CoderControlPlane codercontrolplane-sample with status.operatorAccessReady +# true and spec.templateTests.ownerUserID set to the tester's Coder user ID. +# - The template below exists in Coder. +# +# The spec is immutable. To test again, delete this object or use a new name. +apiVersion: coder.com/v1alpha1 +kind: CoderTemplateTest +metadata: + name: codertemplatetest-sample + namespace: coder +spec: + controlPlaneRef: + name: codercontrolplane-sample + # .