terraform/internal/refactoring
Martin Atkins ee9e346039 refactoring: ApplyMoves skips moving when destination address occupied
Per our rule that the content of the state can never make a move statement
invalid, our behavior for two objects trying to occupy the same address
will be to just ignore that and let the object already at the address
take priority.

For the moment this is silent from an end-user perspective and appears
only in our internal logs. However, I'm hoping that our future planned
adjustment to the interface of this function will include some way to
allow reporting these collisions in some end-user-visible way, either as
a separate warning per collision or as a single warning that collects
together all of the collisions into a single message somehow.

This situation can arise both because the previous run state already
contained an object at the target address of a move and because more than
one move ends up trying to target the same location. In the latter case,
which one "wins" is decided by our depth-first traversal order, which is
in turn derived from our chaining and nesting rules and is therefore
arbitrary but deterministic.
2021-09-20 09:06:22 -07:00
..
testdata refactoring: ImpliedMoveStatements function 2021-09-20 09:06:22 -07:00
move_execute.go refactoring: ApplyMoves skips moving when destination address occupied 2021-09-20 09:06:22 -07:00
move_execute_test.go refactoring: ApplyMoves skips moving when destination address occupied 2021-09-20 09:06:22 -07:00
move_statement.go refactoring: ImpliedMoveStatements function 2021-09-20 09:06:22 -07:00
move_statement_test.go refactoring: ImpliedMoveStatements function 2021-09-20 09:06:22 -07:00
move_validate.go refactoring: First round of ValidateMoves rules 2021-07-29 12:29:36 -07:00
move_validate_test.go refactoring: TestValidateMoves/cyclic_chain can now pass 2021-09-15 08:46:12 -07:00