Skip to content

[BUG] Stack overflow on Windows when linting repositories with Kustomize manifests since v0.8.0 #1195

Description

@gologames

System info:

  • OS: Windows

Describe the bug
kube-linter crashes with a Go stack overflow on Windows when linting a repository that contains Kustomize manifests.

This reproduces with v0.8.3. v0.7.6 does not crash. Native Kustomize rendering was added in v0.8.0 via #1045.

To Reproduce
Steps to reproduce the behavior:

  1. Run kube-linter on Windows against a repository containing Kustomize manifests.
  2. Example command:
kube-linter lint . --config .kube-linter.yaml
  1. With v0.8.3, the command crashes with stack overflow.

Sample YAML input
The crash was reproduced on a repository containing Kustomize manifests. The failure happens before normal lint results are returned.

Expected behavior
kube-linter should not crash. It should either report normal lint findings or complete with no lint errors.

Screenshots
N/A

Additional context
The stack trace repeatedly shows recursion in kyaml's in-memory filesystem:

runtime: goroutine stack exceeds 1000000000-byte limit
fatal error: stack overflow

sigs.k8s.io/kustomize/kyaml/filesys.(*fsNode).addDir
sigs.k8s.io/kustomize/kyaml@v0.20.1/filesys/fsnode.go:169
github.com/lburgazzoli/k8s-manifests-lib/pkg/renderer/kustomize/unionfs.(*Builder).Build
github.com/lburgazzoli/k8s-manifests-lib/pkg/renderer/kustomize.(*Engine).prepareFilesystem
golang.stackrox.io/kube-linter/pkg/lintcontext.(*lintContextImpl).loadObjectsFromKustomize

Full stack trace:

kube-linter-v0.8.3-windows-stack-overflow.log

The stack trace points to github.com/lburgazzoli/k8s-manifests-lib while kube-linter is rendering Kustomize manifests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions