skip inter-provider cycle check in destroy plan

Just like in the destroy apply, we can skip the inter-provider cycle
check when creating the destroy plan, which can be expensive when there
are a lot of resource instances with dependencies from another provider.
This commit is contained in:
James Bardin 2023-04-24 08:43:23 -04:00
parent 357012a2f3
commit 583350a5c4
2 changed files with 4 additions and 2 deletions

View File

@ -191,7 +191,9 @@ func (b *PlanGraphBuilder) Steps() []GraphTransformer {
// DestroyEdgeTransformer is only required during a plan so that the
// TargetsTransformer can determine which nodes to keep in the graph.
&DestroyEdgeTransformer{},
&DestroyEdgeTransformer{
Operation: b.Operation,
},
&pruneUnusedNodesTransformer{
skip: b.Operation != walkPlanDestroy,

View File

@ -88,7 +88,7 @@ func (t *DestroyEdgeTransformer) tryInterProviderDestroyEdge(g *Graph, from, to
// If this is a complete destroy operation, then there are no create/update
// nodes to worry about and we can accept the edge without deeper inspection.
if t.Operation == walkDestroy {
if t.Operation == walkDestroy || t.Operation == walkPlanDestroy {
return
}