You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kube-linter version: v0.8.3 (installed via go install golang.stackrox.io/kube-linter/cmd/kube-linter@v0.8.3, kube-linter version reports development as expected for go install builds)
Describe the bug
Linting a Kustomize directory fails with Warning: no valid objects found. when the kustomization (or one of its bases) declares a builtin plugin explicitly via the transformers: field (e.g. an ImageTagTransformer in a separate file). Running with -v reveals the underlying error:
This suggests the embedded krusty kustomizer is constructed with PluginConfig.BpLoadingOptions left at BploUndefined instead of BploUseStaticallyLinked. Explicit transformers:/generators: entries go through kustomize's plugin loader, which validates that option, whereas the equivalent images: shorthand does not — which matches what I observe: the same image override expressed via images: works fine, while the explicit ImageTagTransformer fails. The kustomize CLI builds the same directory without any problem.
To Reproduce
Steps to reproduce the behavior:
Create a standard base/overlay layout (see sample below) where the base kustomization references an ImageTagTransformer via transformers:
Run kube-linter lint overlays/dev
Output: Warning: no valid objects found.
Run kube-linter lint -v overlays/dev to see the rendering error
Replace the transformers: entry with the equivalent images: shorthand in base/kustomization.yaml and re-run: linting now works
Sample YAML input
Directory layout:
.
├── base
│ ├── deployment.yaml
│ ├── image-transformer.yaml
│ └── kustomization.yaml
└── overlays
└── dev
└── kustomization.yaml
Expected behavior
The Kustomize directory should render and lint successfully, as it does with the kustomize CLI: kustomize build overlays/dev | kube-linter lint - works fine on the same input.
Screenshots
N/A — full verbose output:
$ kube-linter lint -v --add-all-built-in ./
Warning: failed to load object from <repo>/overlays/dev: rendering failed: error processing renderer "kustomize" (*kustomize.Renderer): error rendering kustomize path <repo>/overlays/dev: failed to run kustomize for path "<repo>/overlays/dev": failed to run kustomize for path "<repo>/overlays/dev": kustomize run failed: accumulating resources: accumulation err='accumulating resources from '../../base': '<repo>/base' must resolve to a file': recursed accumulation of path '<repo>/base': unknown plugin loader behavior specified: ImageTagTransformer.builtin.[noGrp] BploUndefined
Warning: no valid objects found.
Additional context
Introduced with the new Kustomize support from Add Kustomize Support #1045 (v0.8.0); also reproducible on v0.8.3.
ImageTagTransformer is likely not the only affected plugin — any builtin transformer or generator declared explicitly via transformers:/generators: should hit the same loader code path.
Without -v, the failure is completely silent apart from the generic no valid objects found warning.
Likely fix: set types.BploUseStaticallyLinked in the krusty.Options.PluginConfig used by the kustomize renderer.
System info:
go install golang.stackrox.io/kube-linter/cmd/kube-linter@v0.8.3,kube-linter versionreportsdevelopmentas expected for go install builds)Describe the bug
Linting a Kustomize directory fails with
Warning: no valid objects found.when the kustomization (or one of its bases) declares a builtin plugin explicitly via thetransformers:field (e.g. anImageTagTransformerin a separate file). Running with-vreveals the underlying error:This suggests the embedded krusty kustomizer is constructed with
PluginConfig.BpLoadingOptionsleft atBploUndefinedinstead ofBploUseStaticallyLinked. Explicittransformers:/generators:entries go through kustomize's plugin loader, which validates that option, whereas the equivalentimages:shorthand does not — which matches what I observe: the same image override expressed viaimages:works fine, while the explicitImageTagTransformerfails. ThekustomizeCLI builds the same directory without any problem.To Reproduce
Steps to reproduce the behavior:
ImageTagTransformerviatransformers:kube-linter lint overlays/devWarning: no valid objects found.kube-linter lint -v overlays/devto see the rendering errortransformers:entry with the equivalentimages:shorthand inbase/kustomization.yamland re-run: linting now worksSample YAML input
Directory layout:
base/deployment.yaml:base/image-transformer.yaml:base/kustomization.yaml(fails):Equivalent kustomization using the
images:shorthand (works):overlays/dev/kustomization.yaml:Expected behavior
The Kustomize directory should render and lint successfully, as it does with the kustomize CLI:
kustomize build overlays/dev | kube-linter lint -works fine on the same input.Screenshots
N/A — full verbose output:
Additional context
ImageTagTransformeris likely not the only affected plugin — any builtin transformer or generator declared explicitly viatransformers:/generators:should hit the same loader code path.-v, the failure is completely silent apart from the genericno valid objects foundwarning.types.BploUseStaticallyLinkedin thekrusty.Options.PluginConfigused by the kustomize renderer.