Skip to content

fix(k8s): Take the k8s area of the config-read list to zero - #6124

Merged
dan-petty merged 5 commits into
mainfrom
fix/6119-k8s-config-reads
Nov 17, 2026
Merged

dan-petty merged 5 commits into
mainfrom
fix/6119-k8s-config-reads

Conversation

@dan-petty

@dan-petty dan-petty commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

No test asserts a value of a manifest or config (#6060). Part of #6082: this is the k8s area. The 141 allow-listed tests of the area go: 91 are deleted, 49 test source code on a fixture (the CronJob templates of the roadmap Jobs, an Applications tree, an Ollama profile, an RBAC binding, a settings mapping), and 1 compares the README with the Secret table. The ConfigMap render of deploy-stack now refuses a template key that no setting declares. The guard also counts the readers of tests/support/k8s_tree and judges a path whole. The allow list falls from 554 tests in 89 modules to 411 in 65. Each spec scenario whose test went names a validator or a live check. The decision table is in the design of the change.

Closes #6119

Change: openspec/changes/archive/2026-11-17-6119-k8s-config-reads/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/k8s Kubernetes commands, Helm charts, pods, services, and policies labels Nov 17, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Decisions for the k8s area of #6082

The body of a pull request holds at most 1,000 characters, so the table is here and in design.md of the archived change.

config_reads.toml: 556 tests in 89 modules before, 413 tests in 65 modules after (−141 of the area, −2 of tests/invariants/test_pull_request_template.py, which read a Markdown document and leave the list when the guard judges a path whole).

Group Tests Decision Reason
tests/k8s/test_k8s_cluster_job_api.py, tests/k8s/test_k8s_cluster_job.py 32 + 5 replace build_job and ClusterJobs read the CronJob from the cluster at run time. tests/support/job_templates.py builds a CronJob in the shape of each template.
tests/k8s/test_k8s_configmap_keys.py 4 replace 3 tests run unknown_setting_keys on a built mapping. The check of the committed template moves into the ConfigMap render (src), with a fixture test in tests/k8s/test_k8s_configmap.py.
tests/commands/k8s/test_k8s.py (prometheus values order, native ConfigMap apply, CRD teardown) 3 replace Values order: a deploy-stack dry run on a tree that the test writes, plus a test of a release that no Application pins. The two others keep the code asserts and lose the asserts of committed names and of the CRD keep annotation.
tests/invariants/test_k8s_argocd_apps.py (chart sources, deploy-stack counterpart) 2 replace chart_versions on written Applications (tests/k8s/test_app_sources.py) and the dry run above.
tests/commands/k8s/test_k8s_gpu_placement.py 1 replace A written Ollama profile with one tier that needs an architecture.
tests/commands/k8s/test_k8s_agents_manifests.py (audit of the agents binding) 1 replace audit_rbac on a built binding; devops k8s rbac-audit audits the live cluster.
tests/commands/k8s/test_k8s_devops_stack.py 1 replace The order rule (rate limit before the Ingress) stays as a test of the source table; file existence is the work of the k8s row and of a deploy.
tests/invariants/test_k8s_manifests.py::test_readme_lists_the_table 1 keep Compares the README, a document, with CLUSTER_SECRETS; no manifest value. The guard counted it only through REPO_ROOT / "k8s".
Namespaces, security contexts, tokens, RBAC, perimeters, prune protection, finalizers, secret references, chart values, pins, nested timeouts, notifier keys, Valkey bounds, Mattermost, Gitea, Qdrant, Tempo, logging, gateway config, devops runtime, Crawl4AI, SearXNG, Renovate 91 delete Each asserts a value of a manifest, chart values or config file (#6060; owner, 2026-11-17, "Delete them all now"). kube-linter (#6068), the k8s row, trivy config and the live checks cover the controls.

Also deleted, because the guard did not count them (reads through the tests.support.k8s_tree readers or REPO_ROOT.joinpath(*parts)): 2 Crawl4AI, 1 GPU feature discovery, 5 MCP server policies, 10 token gate / secret guard / routes in test_k8s_manifests.py (+5 tests of their helpers), 7 Renovate, 8 SearXNG (with tests/fixtures/searxng/engines_that_never_answer.txt), all 15 of tests/core/test_k8s_local_path_placement.py, and the Loki retention test of test_k8s.py. The guard now counts a call of a reader of tests.support.k8s_tree.

Spec scenarios: 31 capabilities changed in the archived change. Each scenario whose test went names a validator (devops k8s lint, devops ci --check --only k8s) or a live check (devops k8s searxng-check, crawl4ai-check, doctor --stack gitea, kubectl). Requirements whose scenarios described the deleted test itself are removed, with a new requirement that holds the rule.

Guard gaps left for the next areas: REPO_ROOT.joinpath(*parts) helpers (tests/core/test_renovate_config.py) and support modules that read k8s/ (tests/support/fakes/cluster_jobs.py). The comment in k8s/llm/values-qdrant.yaml that names a deleted test is not changed here, because this pull request changes no manifest (#6112, #6099).

@dan-petty

Copy link
Copy Markdown
Owner Author

Check results

Head commit: dc807c3bd1de2b4c3db22928466bb2437e32475d

Check Conclusion Link
Tests & Coverage success run
devops-cli success run
zizmor success run
trivy-config success run
Dependency Freshness skipped run
Tests on Main skipped run
Test Job Duration skipped run
Changed-Test Independence success run
Tests & Coverage (shard 1 of 4) success run
Design Tokens success run
Tests & Coverage (shard 4 of 4) success run
Tests & Coverage (shard 2 of 4) success run
MCP Server Image success run
Tests & Coverage (shard 3 of 4) success run
Static Analysis success run
Runner Image success run
Service Image success run
Plan Check skipped run
CodeQL success run
Fail-to-Pass Check success run
Docs Site Build success run
Semantic PR title success run
Image Pins success run
Analyze (python) success run
Analyze (actions) success run

Fail-to-pass run: https://github.com/dan-petty/devops-cli/actions/runs/44020692049/job/133829232030

Skipped check: Dependency Freshness
Skipped check: Tests on Main
Skipped check: Test Job Duration
Skipped check: Plan Check

@dan-petty
dan-petty marked this pull request as ready for review November 17, 2026 05:07
@dan-petty
dan-petty force-pushed the fix/6119-k8s-config-reads branch from 97410e0 to 7ef1680 Compare November 17, 2026 07:47
@devops-cli-service

Copy link
Copy Markdown
Contributor

Pull request #6124 has merge conflicts with main at commit 7ef168055dc0. GitHub cannot merge it. Rebase the branch onto the current main, resolve the conflicts and push the branch.

#6120 changed or removed 39 requirements of 12 capabilities that the
deltas of this change also changed. The deltas keep the text of #6120
for each of them, and drop the REMOVED and ADDED pairs whose old title
#6120 already replaced.
@dan-petty
dan-petty force-pushed the fix/6119-k8s-config-reads branch from 7ef1680 to f9631a8 Compare November 17, 2026 08:20
@dan-petty
dan-petty enabled auto-merge (squash) November 17, 2026 08:25
@dan-petty

Copy link
Copy Markdown
Owner Author

Rebase onto main at 485e4cd (new head f9631a8)

The branch now starts at 485e4cd04 (#6138). The three work commits applied with no text conflict. The archive commit 7ef168055 went, because its edits of the living specs overlapped #6120. The change went back to active, its deltas were corrected against the living specs of main, and uv run devops openspec archive archived it again in the last commit.

Conflicts and resolutions

#6120 (#6118) changed or removed 39 requirements that the deltas of this change also changed, in 12 capabilities. Each MODIFIED block of #6124 changed only the scenario. Each version on main already names a command proof with no kubectl exec, or main removed the requirement. So the resolution keeps the text of main for each of them and drops the delta.

Capability Requirements of the delta Resolution
cluster-image-registry "Gitea's container registry is on" main renamed it "Gitea serves the container registry of the cluster" (port-forward, GET /v2/ gives 401). Delta dropped.
crawl4ai-service Pod Security, the token and the switches, only the roadmap Service calls, DNS and public web only main text kept (rollout status and jsonpath, devops k8s lint, devops k8s crawl4ai-check, a kubectl run probe pod with nc). The delta of "The deploy stack and the kustomizations list every file" stays: main did not change it, and it named the deleted test.
gitea-forge 5 (namespace, data, closed forge, rootless, perimeter) main renamed all 5 with command proofs (--dry-run=server probe, kubectl get, port-forward, rollout status, nc probe pods). Delta file dropped.
gitops-host-overrides "The app-of-apps applies the homelab Applications server-side" main renamed it "Argo CD applies three homelab Applications server-side" (--show-managed-fields). Delta dropped.
grafana-image-renderer 5 main text kept. The scenario "a test reads the cluster Secret table" stays on both sides, because a test of the source table covers it. Delta file dropped.
k8s-network-policies 4 main text kept. Delta file dropped.
llm-gateway-database the CloudNativePG dashboard main text kept (devops grafana dashboards lint, devops grafana search). Delta dropped.
local-path-volume-placement REMOVED "A pod that mounts a claim does not run on the control-plane node" + ADDED "A pod on a claim keeps off the control-plane node" main already removed the old title and added "A pod on a claim requires a node off the control plane" with kubectl get pods proofs. Both blocks dropped, so the spec holds no second copy of the rule.
qdrant-read-only-key "Qdrant reads a read-only key", "The pod config names the Qdrant Service" main text kept (port-forward, search 200, upsert 403). main removed the second because it only restates a file value. Delta file dropped.
renovate-service 5 main text kept. The delta of "No upgrade task runs until the token is out of its reach" stays: main did not change it, and its scenario said "the test fails".
searxng-service 7 MODIFIED, 2 REMOVED (the engines that never answer, the document of the kept engines) main text kept for the 7, and main already removed the 2. The delta of "The deploy stack and the kustomizations list every file" stays.
service-account-tokens REMOVED "A pod that does not call the Kubernetes API mounts no ServiceAccount token" + ADDED "A pod mounts a ServiceAccount token only when a role binds its ServiceAccount" main renamed the rule "A pod with no role mounts no ServiceAccount token" (kubectl get pods,rolebindings,clusterrolebindings). Both blocks dropped. The REMOVED "The check finds each token that a pod mounts" stays: the check was a helper of the deleted token tests of tests/invariants/test_k8s_manifests.py.

The deltas of the other 19 capabilities (and the 4 kept blocks above) touch requirements that main did not change, so they stay as they were. proposal.md and design.md of the change now name this split.

Checks

uv run devops ci --check --only test-tree,k8s,kube-linter,openspec,docs: all 5 rows pass. The 17 changed test modules and the tests of src/devops_cli/k8s/configmap.py: 241 passed.

On GitHub, head f9631a883: 25 of 25 checks pass. Plan Check, Tests on Main, Test Job Duration and Dependency Freshness skip, as they did before the rebase. The pull request stays ready. Only the review of a person is open.

@dan-petty
dan-petty merged commit 0857ee5 into main Nov 17, 2026
25 checks passed
@dan-petty
dan-petty deleted the fix/6119-k8s-config-reads branch November 17, 2026 08:31
dan-petty added a commit that referenced this pull request Nov 17, 2026
The scenarios of the image, release pin and devcontainer specs said
"a test reads" a file. Each one now names a validator, a dry run, an
install, an image build or a live check as its proof (#6080). No
scenario enters a pod with kubectl exec. #6124 already gave the Ollama
and Traefik pins a kubectl get live check, so their scenarios stay.

Closes #6125
dan-petty added a commit that referenced this pull request Nov 17, 2026
…6126)

The image, release pin and devcontainer specs said "a test reads" a
file. #6060 removes such tests, and the stage and refine jobs copy the
living specs. Each scenario of 7 capabilities now names its proof in the
form of #6080: `image-pins`, `devcontainer validate`, a dry run of
`deploy-stack` or `install-tools`, an install, an image build, or a live
check (`kubectl get` of the pod image against the floor or `helm show
chart`, never `kubectl exec`; `findmnt`, `pids.max`). #6124 already gave
the Ollama and Traefik pins a `kubectl get` check, so their scenarios
stay.

- 3 requirements that only restate a file, or ask for a deleted test,
go.
- 5 requirements come back under a new name, because OpenSpec keeps each
scenario name of a MODIFIED requirement.

Census `git grep -c -i "a test reads" -- openspec/specs`: the area falls
from 18 to 0, all specs from 209 to 191. Part of #6083.

Closes #6125

Change:
`openspec/changes/archive/2026-11-17-6125-image-pin-spec-proofs/`
dan-petty pushed a commit that referenced this pull request Nov 17, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.171.0](v0.170.0...v0.171.0)
(2026-11-17)


### Features

* **roadmap:** Run review scanners in the runner pod
([#6114](#6114))
([ddde85a](ddde85a))
* **service:** Roll the Service with a surge release
([#6146](#6146))
([a459b65](a459b65))


### Bug Fixes

* **k8s:** Run kube-linter on the Argo CD builds in CI
([#6112](#6112))
([dba90f1](dba90f1)),
closes [#6068](#6068)
* **k8s:** Take the k8s area of the config-read list to zero
([#6124](#6124))
([0857ee5](0857ee5)),
closes [#6119](#6119)
* **roadmap:** judge a pyproject tool setting by its diff
([#6089](#6089))
([0a787eb](0a787eb)),
closes [#3491](#3491)
* **roadmap:** Name both command registration forms
([#6148](#6148))
([0d3b1e1](0d3b1e1))
* **roadmap:** Read the files of a named pull request
([#6144](#6144))
([5a29fed](5a29fed))
* **roadmap:** refuse a placeholder group title in a plan
([#6092](#6092))
([cfd820b](cfd820b))
* **service:** the metrics row sends too many counted requests
([#6095](#6095))
([b3fc5dc](b3fc5dc))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/k8s Kubernetes commands, Helm charts, pods, services, and policies type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(k8s): Take the k8s area of the config-read allow list to zero

1 participant