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{
|
||||
State: &state,
|
||||
},
|
||||
&EvalApply{
|
||||
Info: info,
|
||||
State: &state,
|
||||
Diff: &diffApply,
|
||||
Provider: &provider,
|
||||
Output: &state,
|
||||
Error: &err,
|
||||
// Make sure we handle data sources properly.
|
||||
&EvalIf{
|
||||
If: func(ctx EvalContext) (bool, error) {
|
||||
if n.Resource.Mode == config.DataResourceMode {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
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{
|
||||
Name: n.stateId(),
|
||||
|
|
Loading…
Reference in New Issue