GoogleContainerTools/skaffold · error
no Kustomization configuration found in directory: %s
Error message
no Kustomization configuration found in directory: %s
What it means
FindKustomizationConfig checks each of constants.KustomizeFilePaths (kustomization.yaml, kustomization.yml, Kustomization) in a directory and errors when none exist. Called from DependenciesForKustomization while resolving a kustomize directory into its file dependencies.
Source
Thrown at pkg/skaffold/render/renderer/kustomize/kustomize.go:556
if generator.EnvSource != "" {
envs = append(envs, generator.EnvSource)
}
deps = append(deps, sUtil.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
}
// kustomizeBuildArgs returns a list of build args to be passed to kustomize build.
func kustomizeBuildArgs(buildArgs []string, kustomizePath string) []string {
var args []string
if len(buildArgs) > 0 {View on GitHub (pinned to a1189de023)
Solutions
- Create kustomization.yaml (or yml / Kustomization) in the target directory
- Correct the configured path to the directory that actually holds the kustomization file
- Rename misspelled variants (kustomisation.yaml) to an accepted candidate name
- Verify the file exists in CI (git add/commit, correct checkout)
Example fix
// before ls base/ # only deployment.yaml // after printf 'resources:\n - deployment.yaml\n' > base/kustomization.yaml
Defensive patterns
Strategy: validation
Validate before calling
func hasKustomization(dir string) bool {
for _, n := range []string{"kustomization.yaml","kustomization.yml","Kustomization"} {
if _, err := os.Stat(filepath.Join(dir, n)); err == nil { return true }
}
return false
} Prevention
- Only configure kustomize.paths that directly contain a kustomization file
- Standardize on kustomization.yaml spelling across the repo
- Add a repo lint step asserting each configured path passes FindKustomizationConfig equivalent
When it happens
Trigger: A path in Kustomize.Paths resolves (after expansion) to a directory with no recognized kustomization file present.
Common situations: Wrong directory in skaffold.yaml (parent of overlays rather than the overlay); file named kustomisation.yaml (British spelling); file extension .yaml vs .yml mismatch with none of the three candidates; uncommitted kustomization.yaml in CI checkout.
Related errors
- cannot locate kustomization file from provided directory: %s
- rendering manifests: %w
- unable to parse path %q: %w
- failed to apply setter to file %s, err: %v
- kustomization parse error in %v: %w
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/918582d44eb6a6fc.
Report an issue: GitHub.