Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error msg returned when no kustomization file is found #771

Merged
merged 1 commit into from Feb 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/constants/constants.go
Expand Up @@ -21,7 +21,7 @@ package constants
// by Kustomize.
// In each directory, Kustomize searches for file with the name in this list.
// Only one match is allowed.
var KustomizationFileNames = [3]string{
var KustomizationFileNames = []string{
"kustomization.yaml",
"kustomization.yml",
"Kustomization",
Expand Down
5 changes: 3 additions & 2 deletions pkg/target/kusttarget.go
Expand Up @@ -88,11 +88,12 @@ func loadKustFile(ldr ifc.Loader) ([]byte, error) {
}
switch match {
case 0:
return nil, fmt.Errorf("no kustomization.yaml file under %s", ldr.Root())
return nil, fmt.Errorf("No kustomization file found in %s. Kustomize supports the following kustomization files: %s",
ldr.Root(), strings.Join(constants.KustomizationFileNames, ", "))
case 1:
return content, nil
default:
return nil, fmt.Errorf("Found multiple kustomization file under: %s\n", ldr.Root())
return nil, fmt.Errorf("Found multiple kustomization files under: %s\n", ldr.Root())
}
}

Expand Down