Make merge anchor errors for traversing nonfatal

This commit is contained in:
Steven WdV
2025-06-16 13:33:42 +02:00
parent bfcb3fc6b7
commit 31628e7324
3 changed files with 5 additions and 16 deletions
+4 -2
View File
@@ -305,9 +305,10 @@ func traverseMergeAnchor(newMatches *orderedmap.OrderedMap, value *CandidateNode
childValue = childValue.Alias
}
if childValue.Kind != MappingNode {
return fmt.Errorf(
log.Debugf(
"can only use merge anchors with maps (!!map) or sequences (!!seq) of maps, but got sequence containing %v",
childValue.Tag)
return nil
}
err := doTraverseMap(newMatches, childValue, wantedKey, prefs, splat)
if err != nil {
@@ -316,7 +317,8 @@ func traverseMergeAnchor(newMatches *orderedmap.OrderedMap, value *CandidateNode
}
return nil
default:
return fmt.Errorf("can only use merge anchors with maps (!!map) or sequences (!!seq) of maps, but got %v", value.Tag)
log.Debugf("can only use merge anchors with maps (!!map) or sequences (!!seq) of maps, but got %v", merge.Tag)
return nil
}
}