opentofu/internal/terraform/graph_builder_destroy_plan.go
James Bardin 8fed14fc59 use the PlanGraphBuilder for destroy
Rather than maintain a separate graph builder for destroy, use the
normal plan graph with some extra options. Utilize the same pattern as
the validate graph for now, where we take the normal plan graph builder
and inject a new concrete function for the destroy nodes.
2022-05-27 10:59:11 -04:00

18 lines
393 B
Go

package terraform
import (
"github.com/hashicorp/terraform/internal/dag"
)
func DestroyPlanGraphBuilder(p *PlanGraphBuilder) GraphBuilder {
p.ConcreteResourceInstance = func(a *NodeAbstractResourceInstance) dag.Vertex {
return &NodePlanDestroyableResourceInstance{
NodeAbstractResourceInstance: a,
skipRefresh: p.skipRefresh,
}
}
p.destroy = true
return p
}