mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-17 17:52:12 +00:00
improve tests for alternative kustomization file names
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
"testing"
|
||||
|
||||
kusttest_test "sigs.k8s.io/kustomize/v3/pkg/kusttest"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/plugins/testenv"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/plugins/testenv"
|
||||
)
|
||||
|
||||
// This is an example of using a helm chart as a base,
|
||||
|
||||
@@ -81,7 +81,7 @@ func commaOr(q []string) string {
|
||||
func loadKustFile(ldr ifc.Loader) ([]byte, error) {
|
||||
var content []byte
|
||||
match := 0
|
||||
for _, kf := range pgmconfig.KustomizationFileNames() {
|
||||
for _, kf := range pgmconfig.RecognizedKustomizationFileNames() {
|
||||
c, err := ldr.Load(kf)
|
||||
if err == nil {
|
||||
match += 1
|
||||
@@ -92,7 +92,7 @@ func loadKustFile(ldr ifc.Loader) ([]byte, error) {
|
||||
case 0:
|
||||
return nil, fmt.Errorf(
|
||||
"unable to find one of %v in directory '%s'",
|
||||
commaOr(quoted(pgmconfig.KustomizationFileNames())),
|
||||
commaOr(quoted(pgmconfig.RecognizedKustomizationFileNames())),
|
||||
ldr.Root())
|
||||
case 1:
|
||||
return content, nil
|
||||
|
||||
Reference in New Issue
Block a user