mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-30 10:47:14 -06:00
ebb129f051
This was caught by an acceptance test. We've now added a unit test. When refreshing, an orphan (no config) data source should just be deleted.
23 lines
541 B
Go
23 lines
541 B
Go
package terraform
|
|
|
|
// NodeDestroyableDataResource represents a resource that is "plannable":
|
|
// it is ready to be planned in order to create a diff.
|
|
type NodeDestroyableDataResource struct {
|
|
*NodeAbstractResource
|
|
}
|
|
|
|
// GraphNodeEvalable
|
|
func (n *NodeDestroyableDataResource) EvalTree() EvalNode {
|
|
addr := n.NodeAbstractResource.Addr
|
|
|
|
// stateId is the ID to put into the state
|
|
stateId := addr.stateId()
|
|
|
|
// Just destroy it.
|
|
var state *InstanceState
|
|
return &EvalWriteState{
|
|
Name: stateId,
|
|
State: &state, // state is nil here
|
|
}
|
|
}
|