{"record":{"id":"cff6e5a5b932900a","repo":"GoogleContainerTools/skaffold","slug":"no-kustomization-configuration-found-in-directory","errorCode":null,"errorMessage":"no Kustomization configuration found in directory: %s","messagePattern":"no Kustomization configuration found in directory: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/render/generate/util.go","lineNumber":181,"sourceCode":"\t\tif generator.Env != \"\" {\n\t\t\tenvs = append(envs, generator.Env)\n\t\t}\n\t\tdeps = append(deps, util.AbsolutePaths(dir, envs)...)\n\t}\n\n\treturn deps, nil\n}\n\n// FindKustomizationConfig finds the kustomization config relative to the provided dir.\n// A Kustomization config must be at the root of the directory. Kustomize will\n// error if more than one of these files exists so order doesn't matter.\nfunc FindKustomizationConfig(dir string) (string, error) {\n\tfor _, candidate := range constants.KustomizeFilePaths {\n\t\tif local, _ := pathExistsLocally(candidate, dir); local {\n\t\t\treturn filepath.Join(dir, candidate), nil\n\t\t}\n\t}\n\treturn \"\", fmt.Errorf(\"no Kustomization configuration found in directory: %s\", dir)\n}\n\nfunc pathExistsLocally(filename string, workingDir string) (bool, os.FileMode) {\n\tpath := filename\n\tif !filepath.IsAbs(filename) {\n\t\tpath = filepath.Join(workingDir, filename)\n\t}\n\tif f, err := os.Stat(path); err == nil {\n\t\treturn true, f.Mode()\n\t}\n\treturn false, 0\n}\n\ntype kCfg struct {\n\tcontext   string\n\tconfig    string\n\tnamespace string\n}","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/render/generate/util.go#L163-L199","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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"],"exampleFix":"// before\nrender:\n  generate:\n    kustomize:\n      paths: [\"./deploy\"]   # deploy/ has no kustomization.yaml\n// after\n    kustomize:\n      paths: [\"./deploy/overlays/dev\"]  # contains kustomization.yaml","handlingStrategy":"validation","validationCode":"for f in kustomization.yaml kustomization.yml kustomize.yml Kustomization; do [ -f \"$DIR/$f\" ] && echo \"found $f\"; done","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"no Kustomization configuration found\") {\n    // extract dir from the message and verify the kustomization file name/case\n}","preventionTips":["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"],"tags":["kustomize","missing-file","path-resolution","configuration"],"backgroundTag":"kustomization-file-not-found","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}