mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 10:00:56 +00:00
Improve error handling during var resolution.
This commit is contained in:
@@ -22,6 +22,12 @@ import (
|
||||
"sigs.k8s.io/kustomize/pkg/constants"
|
||||
)
|
||||
|
||||
func TestNewOptionsToSilenceCodeInspectionError(t *testing.T) {
|
||||
if NewOptions("foo", "bar") == nil {
|
||||
t.Fatal("could not make new options")
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildValidate(t *testing.T) {
|
||||
var cases = []struct {
|
||||
name string
|
||||
|
||||
@@ -94,7 +94,7 @@ func (a *flagsAndArgs) ExpandFileSource(fSys fs.FileSystem) error {
|
||||
if key != "" {
|
||||
if len(result) != 1 {
|
||||
return fmt.Errorf(
|
||||
"'pattern '%s' catches files %v, should catch only one.", pattern, result)
|
||||
"'pattern '%s' catches files %v, should catch only one", pattern, result)
|
||||
}
|
||||
fileSource := fmt.Sprintf("%s=%s", key, result[0])
|
||||
results = append(results, fileSource)
|
||||
|
||||
Reference in New Issue
Block a user