@@ -66,7 +66,7 @@ func (t *TargetsTransformer) selectTargetedNodes(g *Graph, addrs []addrs.Targeta
66
66
// We need to add everything this node depends on or that is closely associated with
67
67
// this node. In case of resource nodes, action triggers are considered closely related
68
68
// since they belong to the resource.
69
- t .addDependencies (g , v , targetedNodes , addrs )
69
+ t .addVertexDependenciesToTargetedNodes (g , v , targetedNodes , addrs )
70
70
71
71
// We inform nodes that ask about the list of targets - helps for nodes
72
72
// that need to dynamically expand. Note that this only occurs for nodes
@@ -138,26 +138,27 @@ func (t *TargetsTransformer) selectTargetedNodes(g *Graph, addrs []addrs.Targeta
138
138
return targetedNodes
139
139
}
140
140
141
- // addDependencies adds dependencies of the targeted vertex. This includes all ancestors in the
142
- // graph. It also includes all action trigger nodes in the graph. Actions are planned after the
141
+ // addVertexDependenciesToTargetedNodes adds dependencies of the targeted vertex to the
142
+ // targetedNodes set. This includes all ancestors in the graph.
143
+ // It also includes all action trigger nodes in the graph. Actions are planned after the
143
144
// triggering node has planned so that we can ensure the actions are only planned if the triggering
144
145
// resource has an action (Create / Update) corresponding to one of the events in the action trigger
145
146
// blocks event list.
146
- func (t * TargetsTransformer ) addDependencies (g * Graph , v dag.Vertex , targetedNodes dag.Set , addrs []addrs.Targetable ) {
147
+ func (t * TargetsTransformer ) addVertexDependenciesToTargetedNodes (g * Graph , v dag.Vertex , targetedNodes dag.Set , addrs []addrs.Targetable ) {
147
148
if targetedNodes .Include (v ) {
148
149
return
149
150
}
150
151
targetedNodes .Add (v )
151
152
152
153
for _ , d := range g .Ancestors (v ) {
153
- t .addDependencies (g , d , targetedNodes , addrs )
154
+ t .addVertexDependenciesToTargetedNodes (g , d , targetedNodes , addrs )
154
155
}
155
156
156
157
if _ , ok := v .(* nodeExpandPlannableResource ); ok {
157
158
// We want to also add the action triggers related to this resource
158
159
for _ , d := range g .Children (v ) {
159
160
if _ , ok := d .(* nodeActionTriggerPlanExpand ); ok {
160
- t .addDependencies (g , d , targetedNodes , addrs )
161
+ t .addVertexDependenciesToTargetedNodes (g , d , targetedNodes , addrs )
161
162
}
162
163
}
163
164
}
@@ -167,7 +168,7 @@ func (t *TargetsTransformer) addDependencies(g *Graph, v dag.Vertex, targetedNod
167
168
if _ , ok := v .(* NodeApplyableResourceInstance ); ok {
168
169
for _ , f := range g .Children (v ) {
169
170
if _ , ok := f .(* nodeActionTriggerApply ); ok {
170
- t .addDependencies (g , f , targetedNodes , addrs )
171
+ t .addVertexDependenciesToTargetedNodes (g , f , targetedNodes , addrs )
171
172
}
172
173
}
173
174
}
0 commit comments