mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-16 11:42:58 -06:00
069f379e75
This commit refactors NodeApplyableOutput and NodeDestroyableOutput into the new Execute() pattern, collapsing the functions in eval_output.go into one place. I also reverted a recent decision to have Execute take a _pointer_ to a walkOperation: I was thinking of interfaces, not constant bytes, so all it did was cause problems. And finally I removed eval_lang.go, which was unused.
21 lines
615 B
Go
21 lines
615 B
Go
package terraform
|
|
|
|
import "log"
|
|
|
|
// NodeDestroyableDataResourceInstance represents a resource that is "destroyable":
|
|
// it is ready to be destroyed.
|
|
type NodeDestroyableDataResourceInstance struct {
|
|
*NodeAbstractResourceInstance
|
|
}
|
|
|
|
var (
|
|
_ GraphNodeExecutable = (*NodeDestroyableDataResourceInstance)(nil)
|
|
)
|
|
|
|
// GraphNodeExecutable
|
|
func (n *NodeDestroyableDataResourceInstance) Execute(ctx EvalContext, op walkOperation) error {
|
|
log.Printf("[TRACE] NodeDestroyableDataResourceInstance: removing state object for %s", n.Addr)
|
|
ctx.State().SetResourceInstanceCurrent(n.Addr, nil, n.ResolvedProvider)
|
|
return nil
|
|
}
|