Merge pull request #6922 from paybyphone/paybyphone_expanded_datasource_destroyfix
core: Ensure EvalReadDataApply is called on expanded destroy nodes
This commit is contained in:
commit
4ca379f3c7
|
@ -894,13 +894,30 @@ func (n *graphNodeExpandedResourceDestroy) EvalTree() EvalNode {
|
||||||
&EvalRequireState{
|
&EvalRequireState{
|
||||||
State: &state,
|
State: &state,
|
||||||
},
|
},
|
||||||
&EvalApply{
|
// Make sure we handle data sources properly.
|
||||||
Info: info,
|
&EvalIf{
|
||||||
State: &state,
|
If: func(ctx EvalContext) (bool, error) {
|
||||||
Diff: &diffApply,
|
if n.Resource.Mode == config.DataResourceMode {
|
||||||
Provider: &provider,
|
return true, nil
|
||||||
Output: &state,
|
}
|
||||||
Error: &err,
|
|
||||||
|
return false, nil
|
||||||
|
},
|
||||||
|
|
||||||
|
Then: &EvalReadDataApply{
|
||||||
|
Info: info,
|
||||||
|
Diff: &diffApply,
|
||||||
|
Provider: &provider,
|
||||||
|
Output: &state,
|
||||||
|
},
|
||||||
|
Else: &EvalApply{
|
||||||
|
Info: info,
|
||||||
|
State: &state,
|
||||||
|
Diff: &diffApply,
|
||||||
|
Provider: &provider,
|
||||||
|
Output: &state,
|
||||||
|
Error: &err,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
&EvalWriteState{
|
&EvalWriteState{
|
||||||
Name: n.stateId(),
|
Name: n.stateId(),
|
||||||
|
|
Loading…
Reference in New Issue