mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Our model for plans/planfile has unfortunately grown inconsistent with changes to our modeling of plans.Plan. Originally we considered the plan "header" and the planned changes as an entirely separate artifact from the prior state, but we later realized that carrying the prior state around with the plan is important to ensuring we always have enough context to faithfully render a plan to the user, and so we added the prior state as a field of plans.Plan. More recently we've also added the "previous run state" to plans.Plan for similar reasons. Unfortunately as a result of that modeling drift our ReadPlan method was silently producing an incomplete plans.Plan object, causing use-cases like "terraform show" to produce slightly different results due to the plan object not round-tripping completely. As a short-term tactical fix, here we add state snapshot reading into the ReadPlan function. This is not an ideal solution because it means that in the case of applying a plan, where we really do need access to the state _file_, we'll end up reading the prior state file twice. However, the goal here is only to heal the modelling quirk with as little change as possible, because we're not currently at a point where we'd be willing to risk regressions from a larger refactoring. |
||
---|---|---|
.. | ||
internal/planproto | ||
objchange | ||
planfile | ||
action_string.go | ||
action.go | ||
changes_src.go | ||
changes_state.go | ||
changes_sync.go | ||
changes.go | ||
doc.go | ||
dynamic_value.go | ||
mode_string.go | ||
mode.go | ||
plan_test.go | ||
plan.go | ||
resourceinstancechangeactionreason_string.go |