mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-10 16:42:51 +00:00
Add test for issue 3489 and improve error messages.
This commit is contained in:
@@ -41,7 +41,7 @@ func (fltr Filter) Filter(obj *yaml.RNode) (*yaml.RNode, error) {
|
||||
if err := fltr.filter(obj); err != nil {
|
||||
s, _ := obj.String()
|
||||
return nil, errors.WrapPrefixf(err,
|
||||
"obj '%s' at path '%v'", s, fltr.FieldSpec.Path)
|
||||
"considering field '%s' of object\n%v", fltr.FieldSpec.Path, s)
|
||||
}
|
||||
return obj, nil
|
||||
}
|
||||
|
||||
@@ -176,8 +176,11 @@ kind: Bar
|
||||
a:
|
||||
b: a
|
||||
`,
|
||||
error: "obj 'kind: Bar\na:\n b: a\n' at path 'a/b/c': " +
|
||||
"expected sequence or mapping node",
|
||||
error: `considering field 'a/b/c' of object
|
||||
kind: Bar
|
||||
a:
|
||||
b: a
|
||||
: expected sequence or mapping node`,
|
||||
filter: fieldspec.Filter{
|
||||
SetValue: filtersutil.SetScalar("e"),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user