Skip to content

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

Done

Description

@dan-petty

Problem

Since #7777 (release v0.258.5), devops k8s lint renders each Helm chart source of the Argo CD Applications. On the environment tree of dan-petty/homelab at 75586af9 it reports about 170 findings with devops-cli v0.259.0, so make k8s-apps and the CI check K8s of that repository fail.

Two causes show in the output:

  • A rendered chart object with no namespace gets none. kube-linter then cannot match a pod to a NetworkPolicy or a ServiceAccount, so it reports non-isolated-pod and non-existent-service-account for objects that exist, such as those of mattermost-operator.
  • The exceptions of .kube-linter-charts.yaml of the environment tree do not apply.

scripts/k8s-checks.py charts of dan-petty/homelab handles both: it sets the destination namespace and applies the exceptions.

Expected behavior

  • A chart object with no namespace takes the destination namespace of its Application, as Argo CD applies it.
  • A finding with a written exception of the environment tree does not fail the lint, or the lint renders no chart source that another check covers.

Reproduction

Run devops k8s lint --k8s-dir <homelab checkout>/k8s with v0.259.0.

Existing Tool Considered

kube-linter reads the namespace of each object and the ignore annotations. helm template --namespace does not write the namespace into objects whose template omits it. No tool is built here.

Activity

  1. added
    type/bug
    scope/k8s
    source/agent
    on Nov 30, 2026
  2. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor
    • Priority: The body states that make k8s-apps and the CI check K8s of the homelab repository fail, which is a CI failure.
    • Related: ci(k8s): Lint the Helm chart sources with kube-linter #6106, which asks for a different change. Both concern linting Helm chart sources with kube-linter, but #6106 added the capability while the candidate fixes the namespace and exception handling in that rendering.
  3. added
    status/new
    effort/medium
    value/high
    priority/p0-critical
    on Nov 30, 2026
  4. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor

    Evidence from a run on dan-petty/homelab main at 77f122e, 2026-11-30:

    • make k8s-apps exits 2 with 173 MEDIUM findings. devops k8s lint exits 1 on each finding.
    • feat(k8s): render Helm chart sources in k8s lint #7777 is in release v0.251.0 and later, not first in v0.258.5: git tag --contains d15c17969 lists v0.251.0 as the first tag. v0.258.4, which homelab pins, holds the change.
    • A branch that changes one entry of service.repos gives the same 173 findings as main. So this item blocks dan-petty/homelab#697.
  5. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 30, 2026
  6. removed
    status/in-review
    owner/agent
    on Nov 30, 2026
  7. devops-cli-service commented on Nov 30, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-30 20:54 UTC

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

    effort/mediumpriority/p0-criticalscope/k8ssource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions