mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 10:30:59 +00:00
fix error message
This commit is contained in:
@@ -542,8 +542,8 @@ func (l PathGetter) getFilter(part, nextPart string, fieldPath *[]string) (Filte
|
||||
// part is a hyphen
|
||||
return GetElementByIndex(-1), nil
|
||||
case part == "*":
|
||||
// part is a asterisk
|
||||
return nil, errors.Errorf("cannot support create option in a multi-value target now")
|
||||
// PathGetter is not support for wildcard matching
|
||||
return nil, errors.Errorf("wildcard is not supported in PathGetter")
|
||||
case IsListIndex(part):
|
||||
// part is surrounded by brackets
|
||||
return l.elemFilter(part)
|
||||
|
||||
@@ -584,7 +584,7 @@ func TestLookup_Fn_create_with_wildcard_error(t *testing.T) {
|
||||
node, err := Parse(s)
|
||||
assert.NoError(t, err)
|
||||
_, err = node.Pipe(LookupCreate(yaml.MappingNode, "a", "b", "*", "t"))
|
||||
assert.Error(t, err, "cannot support create option in a multi-value target now")
|
||||
assert.Error(t, err, "wildcard is not supported in PathGetter")
|
||||
}
|
||||
|
||||
func TestLookup(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user