Skip to content

fix(k8s): k8s lint reads Kustomize path builds with no namespace #7904

Done

Description

@dan-petty

Problem

Since the merge of pull request 7901 (release v0.263.1), devops k8s lint gives the destination namespace of an Argo CD Application to its chart renders only. A path source that Kustomize builds, whose object names no namespace, keeps none. kube-linter then does not match a chart pod with the ServiceAccount or the NetworkPolicy of that path source, and reports both as missing. A tree that passed the lint before now fails.

An Application whose destination names no namespace fails in the same way: its chart objects get default, and its path objects get none.

Reproduction

One Application has two sources and the checks non-isolated-pod and non-existent-service-account:

  • a chart with a Deployment that names no namespace and has serviceAccountName: web
  • a path source with a kustomization of a ServiceAccount web and a NetworkPolicy for the pod, neither with a namespace

Run devops k8s lint --k8s-dir <tree>/k8s with kube-linter 0.8.3 and kubectl 1.37.3, with a destination namespace web, and again with no destination namespace.

  • Commit 1966142: the audit passes in both runs.
  • Commit 8f7654a: both runs report serviceAccount "web" not found and non-isolated-pod.

Expected behavior

  • Each namespaced object of a Kustomize build of a path source that names no namespace takes the destination namespace of its Application, as an object of a chart render does.
  • With no destination namespace, no render gets a namespace from the lint.
  • A path folder with no kustomization is the subject of issue 7899.

Existing Tool Considered

Kustomize, which kubectl kustomize holds. Its builtin NamespaceTransformer already sets the namespace of the chart renders. No tool is built here.

Source

Source: #7901

Activity

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

    @dan-petty
    OwnerAuthor
    • Priority: A tree that passed lint before now fails, which causes CI to fail. The regression commit 8f7654a does not set P0: the author has no write access, and no caller attached it as evidence. A person can set P0 with the label priority/p0-critical.
    • Related: fix(k8s): k8s lint reads folder sources with no namespace #7899, which asks for a different change. Both fix namespace propagation for path sources in k8s lint, but 7899 targets raw folders and the candidate targets Kustomize builds.
  3. added
    value/high
    priority/p1-high
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 30, 2026
  4. removed
    status/in-progress
    owner/agent
    on Nov 30, 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

    effort/lowpriority/p1-highscope/k8ssource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions