improve tests for alternative kustomization file names

This commit is contained in:
Jeffrey Regan
2019-10-04 10:17:49 -07:00
parent 404d2d631a
commit 07e0e46ac7
15 changed files with 61 additions and 43 deletions

View File

@@ -4,22 +4,23 @@
// Package pgmconfig holds global constants for the kustomize tool.
package pgmconfig
// KustomizationFileNames is a list of filenames
// RecognizedKustomizationFileNames is a list of file names
// that kustomize recognizes.
// To avoid ambiguity, a directory cannot contain
// more than one match to this list.
func KustomizationFileNames() []string {
// To avoid ambiguity, a kustomization directory may not
// contain more than one match to this list.
func RecognizedKustomizationFileNames() []string {
return []string{
KustomizationFileName0,
KustomizationFileName1,
KustomizationFileName2}
"kustomization.yaml",
"kustomization.yml",
"Kustomization",
}
}
func DefaultKustomizationFileName() string {
return RecognizedKustomizationFileNames()[0]
}
const (
KustomizationFileName0 = "kustomization.yaml"
KustomizationFileName1 = "kustomization.yml"
KustomizationFileName2 = "Kustomization"
// An environment variable to consult for kustomization
// configuration data. See:
// https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html