From 396f0fee8dd69af088d7573d7d2c5cf02df04c4c Mon Sep 17 00:00:00 2001 From: Ruben Fonseca Date: Fri, 9 Jun 2023 16:05:48 +0200 Subject: [PATCH] fix(intrinsics): continue to process children when transforming (#599) --- intrinsics/tags.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/intrinsics/tags.go b/intrinsics/tags.go index 80d37d72f0..3d6b6d5695 100644 --- a/intrinsics/tags.go +++ b/intrinsics/tags.go @@ -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 {