Skip to content

fix(k8s): exit non-zero when kube-linter is unavailable or reports findings - #2386

Merged
dan-petty merged 2 commits into
mainfrom
fix/2095-k8s-lint-exit-code
Oct 27, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/2095-k8s-lint-exit-code

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

devops k8s lint printed a success line and exited 0 when Kube-linter was not on PATH, and it printed the findings and exited 0 when Kube-linter flagged the manifest. A CI gate that keys on the exit code read both as a pass.

The command now reads the ScanOutcome the scanner returns and branches on its status. When the status is not ran, it prints an error line that names the status and the reason, says the manifest was not audited, and exits 1 without a success line. When the status is ran with findings, it prints the findings and exits 1. A clean run still prints the pass line and exits 0.

Closes #2095

Change: openspec/changes/archive/2026-10-27-2095-k8s-lint-exit-code/

…ndings

`devops k8s lint` printed a success line and exited 0 when kube-linter was
not on PATH, and it printed the findings and exited 0 when kube-linter
flagged the manifest. A CI gate that keys on the exit code read both as a
pass.

The command now reads the ScanOutcome the scanner returns and branches on
its status. When the status is not ran, it prints an error line that names
the status and the reason, says the manifest was not audited, and exits 1
without a success line. When the status is ran with findings, it prints the
findings and exits 1. A clean run still prints the pass line and exits 0.

Fail-to-pass: uv run devops ci fail-to-pass --base origin/main

Closes #2095
Archive the change for issue #2095. It moves the change to
openspec/changes/archive and creates the k8s-lint spec with the exit-code
gate requirements.
@dan-petty
dan-petty marked this pull request as ready for review October 27, 2026 21:37
@dan-petty
dan-petty merged commit 31c5a0b into main Oct 27, 2026
16 checks passed
@dan-petty
dan-petty deleted the fix/2095-k8s-lint-exit-code branch October 27, 2026 21:39
dan-petty pushed a commit that referenced this pull request Oct 27, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.8.0](v0.7.4...v0.8.0)
(2026-10-27)


### Features

* **github:** devops gh issues view shows one issue
([#2374](#2374))
([63be7ed](63be7ed)),
closes [#2361](#2361)
* **repos:** make devops repos worktrees add remove merged worktrees
first ([#2351](#2351))
([6d3a18a](6d3a18a)),
closes [#2338](#2338)


### Bug Fixes

* **k8s:** devops k8s configure-urls saves a run that changes only the
task gateway urls
([#2384](#2384))
([1a7e7c7](1a7e7c7))
* **k8s:** exit non-zero when kube-linter is unavailable or reports
findings ([#2386](#2386))
([31c5a0b](31c5a0b)),
closes [#2095](#2095)
* **scan:** serialize status and reason in JSON and YAML scan output
([#2385](#2385))
([d594b55](d594b55))

---
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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(k8s): devops k8s lint exits non-zero when kube-linter reports findings or is not installed

1 participant