From 741aab31d1d513ee11e10e9557281ce2a0153287 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Tue, 12 May 2020 18:28:01 -0400 Subject: [PATCH] delete unused code this search for orphans was never used --- terraform/node_resource_apply.go | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/terraform/node_resource_apply.go b/terraform/node_resource_apply.go index fc674e6630..d4330a1666 100644 --- a/terraform/node_resource_apply.go +++ b/terraform/node_resource_apply.go @@ -6,7 +6,6 @@ import ( "github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/lang" - "github.com/hashicorp/terraform/states" ) // nodeExpandApplyableResource handles the first layer of resource @@ -48,26 +47,6 @@ func (n *nodeExpandApplyableResource) DynamicExpand(ctx EvalContext) (*Graph, er }) } - // Lock the state while we inspect it to find any resources orphaned by - // changes in module expansion. - state := ctx.State().Lock() - defer ctx.State().Unlock() - - var orphans []*states.Resource - for _, res := range state.Resources(n.Addr) { - found := false - for _, m := range moduleInstances { - if m.Equal(res.Addr.Module) { - found = true - break - } - } - // Address form state was not found in the current config - if !found { - orphans = append(orphans, res) - } - } - return &g, nil }