Skip to content

Commit

Permalink
update comment in component references
Browse files Browse the repository at this point in the history
  • Loading branch information
wildum committed Jan 10, 2025
1 parent 8781b37 commit 8c7cc4b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/runtime/internal/controller/component_references.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ func ComponentReferences(cn dag.Node, g *dag.Graph, l log.Logger, scope *vm.Scop
_, scopeMatch := scope.Lookup(t[0].Name)

if !componentRefMatch && !scopeMatch {
// TODO: this workaround ignores the traversal errors inside of the foreach block
// We are currently using the traversal at the root level to access the references from outside of the foreach block.
// The traversal for the foreach node is used at the foreach level to access the references from outside of the foreach block.
// This is quite handy but not perfect because:
// - it fails with the var
// - it fails at the root level to link two components that are inside of the template (because they are not evaluated at the root level)
// Both cases should be ignored so in theory that works well but it's not pretty + it won't show real errors.
// So we need to find a different approach to traverse the foreach node.
// Both cases should be ignored at the linking level, that's the diags are ignored here.
// This is not super clean, but it should not create any problem since that the errors will be caught either during evaluation or while linking components
// inside of the foreach.
if _, ok := cn.(*ForeachConfigNode); !ok {
diags = append(diags, resolveDiags...)
}
Expand Down

0 comments on commit 8c7cc4b

Please sign in to comment.