File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
pkg/engine/operation/parser Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 8
8
v1 "kusionstack.io/kusion/pkg/apis/status/v1"
9
9
"kusionstack.io/kusion/pkg/engine/operation/graph"
10
10
"kusionstack.io/kusion/pkg/engine/operation/models"
11
+ "kusionstack.io/kusion/pkg/log"
11
12
"kusionstack.io/kusion/third_party/terraform/dag"
12
13
)
13
14
@@ -73,13 +74,21 @@ func LinkRefNodes(
73
74
if ag .HasVertex (parentNode ) {
74
75
parentNode = GetVertex (ag , baseNode ).(* graph.ResourceNode )
75
76
ag .Connect (dag .BasicEdge (rn , parentNode ))
77
+ if cycles := ag .Cycles (); len (cycles ) > 0 {
78
+ ag .RemoveEdge (dag .BasicEdge (rn , parentNode ))
79
+ log .Debug ("Found cycle in graph when merging, removing edge" )
80
+ }
76
81
} else {
77
82
ag .Add (parentNode )
78
83
ag .Connect (dag .BasicEdge (rn , parentNode ))
79
84
}
80
85
} else {
81
86
parentNode = GetVertex (ag , baseNode ).(* graph.ResourceNode )
82
87
ag .Connect (dag .BasicEdge (parentNode , rn ))
88
+ if cycles := ag .Cycles (); len (cycles ) > 0 {
89
+ ag .RemoveEdge (dag .BasicEdge (parentNode , rn ))
90
+ log .Debug ("Found cycle in graph when merging, removing edge" )
91
+ }
83
92
}
84
93
default :
85
94
hasParent := ag .HasVertex (parentNode )
You can’t perform that action at this time.
0 commit comments