mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
delete unused code
this search for orphans was never used
This commit is contained in:
parent
8ba63110ec
commit
741aab31d1
@ -6,7 +6,6 @@ import (
|
|||||||
"github.com/hashicorp/terraform/addrs"
|
"github.com/hashicorp/terraform/addrs"
|
||||||
"github.com/hashicorp/terraform/dag"
|
"github.com/hashicorp/terraform/dag"
|
||||||
"github.com/hashicorp/terraform/lang"
|
"github.com/hashicorp/terraform/lang"
|
||||||
"github.com/hashicorp/terraform/states"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// nodeExpandApplyableResource handles the first layer of resource
|
// 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
|
return &g, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user