Tweak file path handling and logging in test.

This commit is contained in:
Jeffrey Regan
2019-09-18 11:14:41 -07:00
parent a3103f1e62
commit 274b5c3b4e
3 changed files with 40 additions and 17 deletions

View File

@@ -8,6 +8,7 @@ import (
"fmt"
"unicode/utf8"
"github.com/pkg/errors"
"k8s.io/api/core/v1"
"sigs.k8s.io/kustomize/v3/pkg/types"
)
@@ -28,13 +29,13 @@ func (f *Factory) MakeConfigMap(
args *types.ConfigMapArgs) (*v1.ConfigMap, error) {
all, err := f.ldr.LoadKvPairs(args.GeneratorArgs)
if err != nil {
return nil, err
return nil, errors.Wrap(err, "loading KV pairs")
}
cm := makeFreshConfigMap(args)
for _, p := range all {
err = f.addKvToConfigMap(cm, p)
if err != nil {
return nil, err
return nil, errors.Wrap(err, "trouble mapping")
}
}
if f.options != nil {