diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index 0938f1567..dd50230fb 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -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", diff --git a/pkg/target/kusttarget.go b/pkg/target/kusttarget.go index f0b4db87b..94a8b3f00 100644 --- a/pkg/target/kusttarget.go +++ b/pkg/target/kusttarget.go @@ -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()) } }