Fixes update-assign with collect object issue #830

This commit is contained in:
Mike Farah
2021-05-22 08:22:45 +10:00
parent af283315f2
commit 48eeb2a9df
3 changed files with 36 additions and 1 deletions
+4 -1
View File
@@ -17,9 +17,12 @@ import (
...
*/
func collectObjectOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) {
func collectObjectOperator(d *dataTreeNavigator, originalContext Context, expressionNode *ExpressionNode) (Context, error) {
log.Debugf("-- collectObjectOperation")
context := originalContext.Clone()
context.DontAutoCreate = false
if context.MatchingNodes.Len() == 0 {
node := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map", Value: "{}"}
candidate := &CandidateNode{Node: node}