Repository navigation
Description
Problem Description
The roadmap implement job stops because the runner image holds no kubectl and about 20 unit tests need a real kubectl binary. The implement runner Job for #1878 (2026-11-12 14:22-15:32Z, image sha256:c8d2f7c80de33578454240252dfc94730ff674dc124598574e12bc57f551d79c) ran uv run devops ci test. The run failed on the base commit too, with FileNotFoundError: 'kubectl'. The job then stopped with failure class plan_defect.
The runner image leaves kubectl out on purpose (NOT_IN_RUNNER in src/devops_cli/roadmap/runner_tools.py; #3562 defers it). The defect is in the tests: docs/TESTING.md says that a test of src/ starts no system program, that the lookup of a program on PATH is part of its fake, and that a test must not skip based on host state. ADR 0007 (amendment of 2026-10-24) removes the allowance for kubectl offline renderers. The hermetic floor in tests/conftest.py still lets every test start kubectl kustomize and kubectl patch --local, so a test that needs the real binary passes in the devcontainer and on the GitHub runner and fails only where kubectl is missing.
The 21 tests and their causes:
tests/k8s/test_image_pins.py(9 tests): the autouse fixture_kustomize_runs_for_realsendskubectl kustomizeto the real binary. Theimage-pinsworkflow already runsdevops k8s image-pinswith the real tools.tests/k8s/test_k8s_argocd_gate.py(10 tests): the fixture fakeskubectl kustomize, but not the lookup._check_treeinsrc/devops_cli/k8s/argocd_gate.pycallsshutil.which("kubectl")and raisesArgoCDGateErrorwhen it finds nothing.tests/commands/k8s/test_k8s.py::test_deploy_stack_leaves_the_service_digest_image_updater_set_on_application_devops: the test runs a realkubectl patch --localon the patch that deploy-stack sends.tests/commands/k8s/test_k8s_rag_ingest_manifests.py::test_qdrant_secret_scoped_to_ingest_workflow_template_only: the test renders the committedk8s/devopswith a realkubectl kustomize. That is a check of committed files, whichdocs/TESTING.mdputs in thek8srow ofdevops ci.
Reproduction Steps
- Make a directory that holds a symbolic link to each program of
/usr/local/binexceptkubectl, and put it in PATH in place of/usr/local/bin. Do not change the host. - Run
env PATH=<that PATH> uv run pytest -n 6 -q tests/k8s/test_image_pins.py tests/k8s/test_k8s_argocd_gate.py tests/commands/k8s/test_k8s.py tests/commands/k8s/test_k8s_rag_ingest_manifests.py.
Expected vs Actual Behavior
Expected: the tests pass with or without kubectl on PATH, as on the stock GitHub runner and in the runner image.
Actual: 21 tests fail. The output is 21 failed, 2309 passed over the files that name kubectl. The full suite with kubectl hidden gives 24 failed, 23949 passed: the 21 tests above, and the 3 tests of the review_window scenario and test_review_facts, which fail with kubectl on PATH too (#4865).
Environment Diagnostics
Devcontainer with kubectl at /usr/local/bin/kubectl, hidden from PATH for the run. Runner image of the implement job, which holds no kubectl.
Logs, Traces, or Terminal Output
FAILED tests/k8s/test_image_pins.py::test_an_image_on_the_latest_tag_is_not_a_pin - FileNotFoundError: [Errno 2] No such file or directory: 'kubectl'
FAILED tests/k8s/test_k8s_argocd_gate.py::test_a_clean_tree_passes_and_names_each_application_it_built - devops_cli.exceptions.k8s.ArgoCDGateError: kubectl is required to build Argo CD applications. Run 'devops install-tools --tool kubectl'.
FAILED tests/commands/k8s/test_k8s.py::test_deploy_stack_leaves_the_service_digest_image_updater_set_on_application_devops - FileNotFoundError: [Errno 2] No such file or directory: 'kubectl'
FAILED tests/commands/k8s/test_k8s_rag_ingest_manifests.py::test_qdrant_secret_scoped_to_ingest_workflow_template_only - FileNotFoundError: [Errno 2] No such file or directory: 'kubectl'
Proposed fix
test_image_pins.py: answerkubectl kustomizefrom the files of the test tree and the canned chart render.test_k8s_argocd_gate.py: make the fake ofkubectlinclude its lookup on PATH.- The deploy-stack test: check that the patch is a JSON merge patch (RFC 7386) that names
kustomize.patchesalone, with no realkubectl. - The Qdrant Secret test: move it to the
k8srow ofdevops ci(tests/gate/k8s_checks/). - Guard: remove the kubectl offline-renderer allowance from the floor, as ADR 0007 decided, so a test that starts a real
kubectlfails on every host. A floor test proves the refusal.
Related: #1878 (the stopped job), #3562 (kubectl in the runner image, a separate security decision).
Source: #1878
Activity
dan-petty commentedon Nov 12, 2026
The failure stops the roadmap implement job and blocks the CI pipeline.Both address kubectl being absent from the runner image, but #3562 adds the tool to the environment while the candidate fixes the tests to not require it.