Skip to content
This repository was archived by the owner on Oct 17, 2024. It is now read-only.

Commit 396f0fe

Browse files
authored
fix(intrinsics): continue to process children when transforming (#599)
1 parent af3d4b2 commit 396f0fe

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

intrinsics/tags.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,20 @@ func addTagResolver(tag string, resolver func(*yaml.Node) (*yaml.Node, error)) {
4141
}
4242

4343
func resolveTags(node *yaml.Node) (*yaml.Node, error) {
44+
var err error
45+
4446
for tag, fn := range tagResolvers {
47+
// Transform the node if it has the tag
48+
// But keep processing the children
4549
if node.Tag == tag {
46-
return fn(node)
50+
node, err = fn(node)
51+
if err != nil {
52+
return nil, err
53+
}
4754
}
4855
}
4956

5057
if node.Kind == yaml.SequenceNode || node.Kind == yaml.MappingNode {
51-
var err error
5258
for i := range node.Content {
5359
node.Content[i], err = resolveTags(node.Content[i])
5460
if err != nil {

0 commit comments

Comments
 (0)