opentofu/plans
Martin Atkins ab62b330c1 core: Allow planned output changes to be updated during apply
If plan and apply are both run against the same context then we still have
the planned output values in memory while we're doing the apply walk, so
we need to make sure to update them along with the state as we learn the
final known values of each output.

There were actually two different bugs here:

- We weren't removing any existing planned change for an output when
  setting a new one. In retrospect a map would've been a better data
  structure for the output changes, rather than a slice to mimic what we
  do for resource instance objects, but for now we'll leave the structures
  alone and clean up as needed. (The set of outputs should be small for
  any reasonable configuration, so the main impact of this is some ugly
  code in RemoveOutputChange.)

- RemoveOutputChange itself had a bug where it was iterating over the
  resource changes rather than the output changes. This didn't matter
  before because we weren't actually using that function, but now we are.

This fix is confirmed by restoring various existing context apply tests
back to passing again.
2018-11-05 16:02:45 -08:00
..
internal/planproto build: Take protoc out of the "go generate" path 2018-10-18 10:39:20 -07:00
objchange more nil/known checks before val.LengthInt 2018-10-19 16:51:15 -04:00
planfile backend/local: Require caller to set PlanOutBackend with PlanOutPath 2018-10-16 19:14:11 -07:00
action_string.go plans: Regenerate Action.String for new action values 2018-10-16 19:14:11 -07:00
action.go core: Handle forced-create_before_destroy during the plan walk 2018-10-16 19:14:11 -07:00
changes_src.go plans: Retain output value changes for all outputs in memory 2018-10-16 19:14:11 -07:00
changes_state.go plans: New package for in-memory plan models 2018-10-16 18:50:29 -07:00
changes_sync.go core: Allow planned output changes to be updated during apply 2018-11-05 16:02:45 -08:00
changes.go plans: OutputChange.Encode must preserve Addr field 2018-11-01 17:33:10 -07:00
doc.go plans: New package for in-memory plan models 2018-10-16 18:50:29 -07:00
dynamic_value_test.go plans: New package for in-memory plan models 2018-10-16 18:50:29 -07:00
dynamic_value.go core: Re-implement EvalWriteDiff to work with new plan types 2018-10-16 19:14:11 -07:00
plan_test.go make Changes.Empty() not count NoOps 2018-10-16 19:14:11 -07:00
plan.go terraform: Ugly huge change to weave in new State and Plan types 2018-10-16 19:11:09 -07:00