mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
fix errror message using replacement wildcard and create option
This commit is contained in:
@@ -142,7 +142,7 @@ func TestElementSetter(t *testing.T) {
|
||||
|
||||
node = MustParse(`
|
||||
- a: b
|
||||
- c: d
|
||||
- c: d
|
||||
`)
|
||||
// If given a key and no values, ElementSetter will
|
||||
// change node to be an empty list
|
||||
@@ -154,7 +154,7 @@ func TestElementSetter(t *testing.T) {
|
||||
|
||||
node = MustParse(`
|
||||
- a: b
|
||||
- c: d
|
||||
- c: d
|
||||
`)
|
||||
// Return error because ElementSetter will assume all elements are scalar when
|
||||
// there is only value provided.
|
||||
@@ -580,6 +580,13 @@ a: {}
|
||||
assert.Equal(t, "h\n", assertNoErrorString(t)(rn.String()))
|
||||
}
|
||||
|
||||
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")
|
||||
}
|
||||
|
||||
func TestLookup(t *testing.T) {
|
||||
s := `n: o
|
||||
a:
|
||||
|
||||
Reference in New Issue
Block a user