Skip to content

fix(k8s): namespace chart renders and add lint --no-charts - #7901

Merged
dan-petty merged 2 commits into
mainfrom
fix/7889-k8s-lint-chart-namespace
Nov 30, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/7889-k8s-lint-chart-namespace

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

With no TARGET, devops k8s lint failed on an environment tree whose charts another check lints.

  • A chart object that names no namespace now takes the destination namespace of its Application, as Argo CD applies it. The kubectl kustomize build of each chart render runs a NamespaceTransformer with unsetOnly: true, so kube-linter finds the ServiceAccount and the NetworkPolicy of a chart pod.
  • devops k8s lint --no-charts lints the path sources only and names each chart source that it did not lint. It is for a tree whose own check lints the charts, with its own exceptions. The default still renders and lints each chart source.

The product reads no chart exception file of a tree: #6106 left those exceptions to the environment repository. A path folder with no kustomization that names no namespace still gets none (#7899).

Closes #7889

Change: openspec/changes/archive/2026-11-30-7889-k8s-lint-chart-namespace/

@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 30, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Check results

Head commit: 26a8f1d14393b2e9ba1d8aa7e57bdb0b11af649c

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

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

Skipped check: Trivy
Skipped check: Plan Check
Skipped check: Test Job Duration
Skipped check: Tests on Main

@dan-petty

Copy link
Copy Markdown
Owner Author

Proof with the code of this branch on main of dan-petty/homelab at 7569d2c, on 2026-11-30, with the tools of its mise.lock (helm 4.3.2, kubectl 1.37.3, kube-linter 0.8.3) and uv run --project <checkout of this branch> devops as the devops command:

Run Exit Findings
devops k8s lint --no-charts --k8s-dir k8s (21 path builds, 31 chart sources named) 0 0
make k8s-apps with --no-charts added to its recipe in a local clone 0 0
devops k8s lint --k8s-dir k8s (all charts), load average about 10 1 none read: kube-linter timed out after 300 s (#7900)

The same renders with all charts, linted by kube-linter with no time limit at 795c247:

Chart renders Findings Without an exception in .kube-linter-charts.yaml
no destination namespace 172 3 (non-existent-service-account on mattermost-operator and qdrant, non-isolated-pod on qdrant)
destination namespace 169 0

So the default run of homelab still fails on the excepted chart findings. After a release with this change, homelab must change the recipe of make k8s-apps to devops k8s lint --no-charts --k8s-dir k8s in the same pull request as the new release pin, or later: an older release refuses --no-charts. make k8s-charts stays the check of the chart sources.

@dan-petty
dan-petty marked this pull request as ready for review November 30, 2026 16:56
@dan-petty
dan-petty merged commit 8f7654a into main Nov 30, 2026
37 checks passed
@dan-petty
dan-petty deleted the fix/7889-k8s-lint-chart-namespace branch November 30, 2026 17:03
dan-petty-release Bot added a commit that referenced this pull request Nov 30, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.263.1](v0.263.0...v0.263.1)
(2026-11-30)


### Bug Fixes

* **k8s:** namespace chart renders and add lint --no-charts
([#7901](#7901))
([8f7654a](8f7654a))

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

fix(k8s): k8s lint renders charts with no namespace

1 participant