GoogleContainerTools/skaffold · error
no Kustomization configuration found in directory
Error message
no Kustomization configuration found in directory: %s
What it means
FindKustomizationConfig scans a directory for any of constants.KustomizeFilePaths (kustomization.yaml, kustomization.yml, kustomize.yml, Kustomization). If none exist it returns this error. DependenciesForKustomization relies on it to locate the kustomization root for each expanded path.
Solutions
- Point the path at the directory that actually contains kustomization.yaml
- Check filename case exactly matches one of the accepted names (Linux is case-sensitive)
- If the resource entry should be a file (e.g. a base dir vs a manifest), correct it to a directory with a kustomization file
- Create a kustomization.yaml if the directory is meant to be a kustomize root
Example fix
// before
render:
generate:
kustomize:
paths: ["./deploy"] # deploy/ has no kustomization.yaml
// after
kustomize:
paths: ["./deploy/overlays/dev"] # contains kustomization.yaml Defensive patterns
Strategy: validation
Validate before calling
for f in kustomization.yaml kustomization.yml kustomize.yml Kustomization; do [ -f "$DIR/$f" ] && echo "found $f"; done
Try / catch
if err != nil && strings.Contains(err.Error(), "no Kustomization configuration found") {
// extract dir from the message and verify the kustomization file name/case
} Prevention
- Always point kustomize paths at directories containing kustomization.yaml
- Double-check filename case on Linux filesystems
- Keep kustomize roots and their bases in the same project tree
When it happens
Trigger: A kustomize path in the render generate config points to a directory containing no kustomization.yaml/kustomization.yml/kustomize.yml/Kustomization file (called while walking dependencies).
Common situations: Path points to the parent of the kustomize project; file named 'kustomization.yaml' with wrong case on a case-sensitive filesystem; directory only contains raw manifests, not a kustomization; resources entry points at a directory instead of a file.
Related errors
- kustomization parse error in
- action not found for k8s execution mode
- action not found for local execution mode
- applying default repo to
- applying profile
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/cff6e5a5b932900a.
Report an issue: GitHub.
Appendix: source
Thrown at pkg/skaffold/render/generate/util.go:181
if generator.Env != "" {
envs = append(envs, generator.Env)
}
deps = append(deps, util.AbsolutePaths(dir, envs)...)
}
return deps, nil
}
// FindKustomizationConfig finds the kustomization config relative to the provided dir.
// A Kustomization config must be at the root of the directory. Kustomize will
// error if more than one of these files exists so order doesn't matter.
func FindKustomizationConfig(dir string) (string, error) {
for _, candidate := range constants.KustomizeFilePaths {
if local, _ := pathExistsLocally(candidate, dir); local {
return filepath.Join(dir, candidate), nil
}
}
return "", fmt.Errorf("no Kustomization configuration found in directory: %s", dir)
}
func pathExistsLocally(filename string, workingDir string) (bool, os.FileMode) {
path := filename
if !filepath.IsAbs(filename) {
path = filepath.Join(workingDir, filename)
}
if f, err := os.Stat(path); err == nil {
return true, f.Mode()
}
return false, 0
}
type kCfg struct {
context string
config string
namespace string
}View on GitHub (pinned to a1189de023)