Skip to content

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

Description

@dan-petty

What happened

devops k8s lint passes when it did not check, and when it found problems. Measured on 2026-10-24 during #711:

  • With kube-linter absent from PATH, run_kubelinter_scan returns ScanOutcome("unavailable", []). k8s_lint tests only if not findings, so it prints "Kube-linter audit passed: no security warnings." and exits 0 (src/devops_cli/commands/k8s/security_audit.py, near lines 136-137).
  • With kube-linter 0.8.3 present, devops k8s lint on a manifest with findings (k8s/devops/cronjob.yaml, latest-tag) prints the findings table and exits 0.

What should happen

  • When kube-linter is not available, the command says so and exits non-zero. It does not say "passed".
  • When kube-linter reports findings, the command exits non-zero.
  • When kube-linter finds nothing, the command exits 0.

Evidence

  • The two runs above.
  • kube-linter 0.8.3 is pinned in src/devops_cli/tools_lock/tools.lock ([binary.kube-linter]).

Acceptance criteria

  • A test for each of the three outcomes (unavailable, findings, clean) checks the message and the exit code.

Intake folded this item into #1435 as a duplicate. #1435 fixes the agent scan tools in ai/tools/builtin_tools.py and the MCP scan tools. This item fixes the devops k8s lint command in commands/k8s/security_audit.py, which is a different code path with the same kind of defect. This fold is more evidence for #1989.

Activity

  1. added
    type/bug
    scope/k8s
    on Oct 24, 2026
  2. dan-petty commented on Oct 24, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.

  3. added a commit that references this issue on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope/k8stype/bug

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions