terraform/backend/remote
Lee Trout cb0e20ca2b Add support for force pushing with the remote backend
Both differing serials and lineage protections should be bypassed
with the -force flag (in addition to resources).

Compared to other backends we aren’t just shipping over the state
bytes in a simple payload during the persistence phase of the push
command and the force flag added to the Go TFE client needs to be
specified at that time.

To prevent changing every method signature of PersistState of the
remote client I added an optional interface that provides a hook
to flag the Client as operating in a force push context. Changing
the method signature would be more explicit at the cost of not
being used anywhere else currently or the optional interface pattern
could be applied to the state itself so it could be upgraded to
support PersistState(force bool) only when needed.

Prior to this only the resources of the state were checked for
changes not the lineage or the serial. To bring this in line with
documented behavior noted above those attributes also have a “read”
counterpart just like state has. These are now checked along with
state to determine if the state as a whole is unchanged.

Tests were altered to table driven test format and testing was
expanded to include WriteStateForMigration and its interaction
with a ClientForcePusher type.
2020-05-06 12:07:43 -04:00
..
testdata clean up go mod for go-tfe 2019-09-27 14:16:41 -07:00
backend.go Improve remote backend missing token error 2020-02-05 13:25:29 -05:00
backend_apply.go backend/remote: Report invalid variables only remotely 2019-10-18 11:31:19 -07:00
backend_apply_test.go Standardise directory name for test data 2019-06-30 10:16:15 +02:00
backend_common.go backend/remote: move reading policy check logs earlier 2020-04-15 12:31:44 -07:00
backend_context.go backend/remote: Filter environment variables when loading context (#23358) 2019-11-13 11:34:09 -05:00
backend_context_test.go backend/remote: Filter environment variables when loading context (#23358) 2019-11-13 11:34:09 -05:00
backend_mock.go backend/remote: Filter environment variables when loading context (#23358) 2019-11-13 11:34:09 -05:00
backend_plan.go backend/remote: display cost estimate and policy check whenever available 2020-04-13 13:04:53 -07:00
backend_plan_test.go vendor latest go-tfe 2019-09-27 15:13:40 -07:00
backend_state.go Add support for force pushing with the remote backend 2020-05-06 12:07:43 -04:00
backend_state_test.go backend/remote: cleanup test connections 2019-02-07 09:55:19 +01:00
backend_test.go Improve remote backend missing token error 2020-02-05 13:25:29 -05:00
cli.go Change how to fall back from remote to local backend 2018-11-20 22:25:52 +01:00
colorize.go backend/remote: implement the Local interface 2018-11-26 20:50:25 +01:00
remote_test.go Change how to fall back from remote to local backend 2018-11-20 22:25:52 +01:00
testing.go backend/remote: Filter environment variables when loading context (#23358) 2019-11-13 11:34:09 -05:00