GoogleContainerTools/skaffold · error

no Kustomization configuration found in directory: %s

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.

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)

Solutions

  1. Point the path at the directory that actually contains kustomization.yaml
  2. Check filename case exactly matches one of the accepted names (Linux is case-sensitive)
  3. 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
  4. 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

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


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/cff6e5a5b932900a. Report an issue: GitHub.