Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions kyaml/yaml/walk/associative_sequence.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,12 @@ func (l *Walker) setAssociativeSequenceElements(valuesList [][]string, keys []st
var err error
if len(valuesList) > 0 {
if l.MergeOptions.ListIncreaseDirection == yaml.MergeOptionsListPrepend {
// items from patches are needed to be prepended. so we append the
// dest to itemsToBeAdded
// First update dest with the patched items so that patches are not overwritten
dest, err = appendListNode(dest, itemsToBeAdded, validKeys)
if err != nil {
return nil, err
}
// Then use itemsToBeAdded to establish the prepended order
dest, err = appendListNode(itemsToBeAdded, dest, validKeys)
} else {
// append the items
Expand Down