mirror of https://github.com/hashicorp/terraform
terraform: add GraphNodeExecutable interface (#26132)
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.pull/26136/head
parent
42753e7dcc
commit
883e4487a2
@ -0,0 +1,9 @@
|
||||
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
|
||||
}
|
||||
Loading…
Reference in new issue