write updated outputs to the refresh state
If we can evaluate a new output value during plan, write it to the refreshed state as well.
This commit is contained in:
parent
7951b55f88
commit
f222ed7479
|
@ -230,6 +230,13 @@ func (n *NodeApplyableOutput) Execute(ctx EvalContext, op walkOperation) error {
|
||||||
return diags.Err()
|
return diags.Err()
|
||||||
}
|
}
|
||||||
n.setValue(state, changes, val)
|
n.setValue(state, changes, val)
|
||||||
|
|
||||||
|
// If we were able to evaluate a new value, we can update that in the
|
||||||
|
// refreshed state as well.
|
||||||
|
if state = ctx.RefreshState(); state != nil && val.IsWhollyKnown() {
|
||||||
|
n.setValue(state, changes, val)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
default:
|
default:
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue