opentofu/internal/states
Nick Fagerlund 9b449bec99 Sort dependencies when encoding ResourceInstanceObject
Resource dependencies are by nature an unordered collection, but they're
persisted to state as a JSON array (in random order). This makes a mess for
`terraform apply -refresh-only`, which sees the new random order as a change
that requires the user to approve a state update.

(As an additional problem on top of that, the user interface for refresh-only
runs doesn't expect to see that as a type of change, so it says "no changes!
would you like to update to reflect these detected changes?")

This commit changes `ResourceInstanceObject.Encode()` to sort the in-memory
slice of dependencies (lexically, by address) before passing it on to be
compared and persisted. This appears to fix the observed UI issues with a
minimum of logic changes.
2021-12-20 21:46:39 -08:00
..
remote Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
statefile update to use typed sensitive marks 2021-06-25 12:49:07 -04:00
statemgr Upgrade to Go 1.17 2021-08-17 15:20:05 -07:00
doc.go Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
instance_generation.go Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
instance_object_src.go Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
instance_object.go Sort dependencies when encoding ResourceInstanceObject 2021-12-20 21:46:39 -08:00
module.go Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
objectstatus_string.go Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
output_value.go Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
resource_test.go Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
resource.go Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
state_deepcopy.go Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
state_equal.go command/workspace_delete: Allow deleting a workspace with empty husks 2021-10-13 13:54:11 -07:00
state_string.go Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
state_test.go command/workspace_delete: Allow deleting a workspace with empty husks 2021-10-13 13:54:11 -07:00
state.go command/workspace_delete: Allow deleting a workspace with empty husks 2021-10-13 13:54:11 -07:00
sync.go core: refactoring.ImpliedMoveStatements replaces NodeCountBoundary 2021-09-20 09:06:22 -07:00