always evaluate outputs too
Always evaluate outputs during destroy, just like we did for locals. This breaks existing tests, which we will handle separately. Don't reverse output/local node evaluation order during destroy, as they are both being evaluated.
This commit is contained in:
parent
7ac0a46981
commit
08139557f8
|
@ -83,19 +83,13 @@ func (n *NodeApplyableOutput) EvalTree() EvalNode {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&EvalOpFilter{
|
&EvalOpFilter{
|
||||||
Ops: []walkOperation{walkRefresh, walkPlan, walkApply, walkValidate},
|
Ops: []walkOperation{walkRefresh, walkPlan, walkApply, walkValidate, walkDestroy, walkPlanDestroy},
|
||||||
Node: &EvalWriteOutput{
|
Node: &EvalWriteOutput{
|
||||||
Name: n.Config.Name,
|
Name: n.Config.Name,
|
||||||
Sensitive: n.Config.Sensitive,
|
Sensitive: n.Config.Sensitive,
|
||||||
Value: n.Config.RawConfig,
|
Value: n.Config.RawConfig,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&EvalOpFilter{
|
|
||||||
Ops: []walkOperation{walkDestroy, walkPlanDestroy},
|
|
||||||
Node: &EvalDeleteOutput{
|
|
||||||
Name: n.Config.Name,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,6 +96,11 @@ func (t *DestroyValueReferenceTransformer) Transform(g *Graph) error {
|
||||||
// reverse any outgoing edges so that the value is evaluated first.
|
// reverse any outgoing edges so that the value is evaluated first.
|
||||||
for _, e := range g.EdgesFrom(v) {
|
for _, e := range g.EdgesFrom(v) {
|
||||||
target := e.Target()
|
target := e.Target()
|
||||||
|
switch target.(type) {
|
||||||
|
case *NodeApplyableOutput, *NodeLocal:
|
||||||
|
// don't reverse other values
|
||||||
|
continue
|
||||||
|
}
|
||||||
log.Printf("[TRACE] output dep: %s", dag.VertexName(target))
|
log.Printf("[TRACE] output dep: %s", dag.VertexName(target))
|
||||||
|
|
||||||
g.RemoveEdge(e)
|
g.RemoveEdge(e)
|
||||||
|
|
Loading…
Reference in New Issue