Skip to content

Commit

Permalink
fix(intrinsics): continue to process children when transforming (awsl…
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfonseca committed Jun 9, 2023
1 parent af3d4b2 commit 396f0fe
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions intrinsics/tags.go
Expand Up @@ -41,14 +41,20 @@ func addTagResolver(tag string, resolver func(*yaml.Node) (*yaml.Node, error)) {
}

func resolveTags(node *yaml.Node) (*yaml.Node, error) {
var err error

for tag, fn := range tagResolvers {
// Transform the node if it has the tag
// But keep processing the children
if node.Tag == tag {
return fn(node)
node, err = fn(node)
if err != nil {
return nil, err
}
}
}

if node.Kind == yaml.SequenceNode || node.Kind == yaml.MappingNode {
var err error
for i := range node.Content {
node.Content[i], err = resolveTags(node.Content[i])
if err != nil {
Expand Down

0 comments on commit 396f0fe

Please sign in to comment.