mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-12 09:01:58 -06:00
883e4487a2
This introduces a new GraphNode, GraphNodeExecutable, which will gradually replace GraphNodeEvalable as part of the overall removal of EvalTree()s. Terraform's Graph.walk function will now check if a node is GraphNodeExecutable and run walker.Execute instead of running through the EvalTree() and Eval(). For the time being, terraform will panic if a node implements both GraphNodeExecutable and GraphNodeEvalable. This will be removed when we've finished removing all GraphNodeEvalable implementations. The new GraphWalker function, Execute(), is meant to replace both EnterEvalTree and ExitEvalTree, and wraps the call to the GraphNodeExecutable's Execute function.
10 lines
380 B
Go
10 lines
380 B
Go
package terraform
|
|
|
|
// GraphNodeExecutable is the interface that graph nodes must implement to
|
|
// enable execution. This is an alternative to GraphNodeEvalable, which is in
|
|
// the process of being removed. A given graph node should _not_ implement both
|
|
// GraphNodeExecutable and GraphNodeEvalable.
|
|
type GraphNodeExecutable interface {
|
|
Execute(EvalContext, walkOperation) error
|
|
}
|