core: fix NodePlannableResourceInstance data reads
The state after EvalReadDataDiff is no longer nil during plan, which means that we can't use that as a proxy for requiring the diff. Rather than exiting early to save the EvalWriteState and EvalWriteDiff evaluations, continue normally regardless to ensure we have the latest diff and state after the plan. This also aligns the data data source handling with that of the managed resource.
This commit is contained in:
parent
bba9660dd4
commit
d217a9cbf8
|
@ -77,23 +77,6 @@ func (n *NodePlannableResourceInstance) evalTreeDataResource(addr addrs.AbsResou
|
||||||
OutputState: &state,
|
OutputState: &state,
|
||||||
},
|
},
|
||||||
|
|
||||||
&EvalIf{
|
|
||||||
If: func(ctx EvalContext) (bool, error) {
|
|
||||||
computed := !configVal.IsWhollyKnown()
|
|
||||||
|
|
||||||
// If the configuration is complete and we
|
|
||||||
// already have a state then we don't need to
|
|
||||||
// do any further work during apply, because we
|
|
||||||
// already populated the state during refresh.
|
|
||||||
if !computed && state != nil {
|
|
||||||
return true, EvalEarlyExitError{}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true, nil
|
|
||||||
},
|
|
||||||
Then: EvalNoop{},
|
|
||||||
},
|
|
||||||
|
|
||||||
&EvalWriteState{
|
&EvalWriteState{
|
||||||
Name: stateId,
|
Name: stateId,
|
||||||
ResourceType: n.Config.Type,
|
ResourceType: n.Config.Type,
|
||||||
|
|
Loading…
Reference in New Issue