@@ -24,9 +24,7 @@ type fieldRef struct {
2424}
2525
2626// makeResourceGraph creates node graph based on ${resources.group.name.id} references.
27- // Returns a graph and a map of all references that have references to them
28- func makeResourceGraph (ctx context.Context , b * bundle.Bundle ) (* dagrun.Graph [deployplan.ResourceNode ], map [deployplan.ResourceNode ]bool , error ) {
29- isReferenced := make (map [deployplan.ResourceNode ]bool )
27+ func makeResourceGraph (ctx context.Context , b * bundle.Bundle ) (* dagrun.Graph [deployplan.ResourceNode ], error ) {
3028 g := dagrun .NewGraph [deployplan.ResourceNode ]()
3129
3230 // Collect and sort nodes first, because MapByPattern gives them in randomized order
@@ -49,7 +47,7 @@ func makeResourceGraph(ctx context.Context, b *bundle.Bundle) (*dagrun.Graph[dep
4947 },
5048 )
5149 if err != nil {
52- return nil , nil , fmt .Errorf ("reading config: %w" , err )
50+ return nil , fmt .Errorf ("reading config: %w" , err )
5351 }
5452
5553 slices .SortFunc (nodes , func (a , b deployplan.ResourceNode ) int {
@@ -64,7 +62,7 @@ func makeResourceGraph(ctx context.Context, b *bundle.Bundle) (*dagrun.Graph[dep
6462
6563 fieldRefs , err := extractReferences (b .Config .Value (), node )
6664 if err != nil {
67- return nil , nil , fmt .Errorf ("failed to read references from config for %s: %w" , node .String (), err )
65+ return nil , fmt .Errorf ("failed to read references from config for %s: %w" , node .String (), err )
6866 }
6967
7068 for _ , fieldRef := range fieldRefs {
@@ -78,12 +76,11 @@ func makeResourceGraph(ctx context.Context, b *bundle.Bundle) (*dagrun.Graph[dep
7876 node ,
7977 label ,
8078 )
81- isReferenced [referencedNode ] = true
8279 }
8380 }
8481 }
8582
86- return g , isReferenced , nil
83+ return g , nil
8784}
8885
8986func extractReferences (root dyn.Value , node deployplan.ResourceNode ) ([]fieldRef , error ) {
0 commit comments