terraform/backend
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
..
atlas backend/atlas: fix use of T.Fatal() inside goroutine 2019-11-06 17:11:15 -08:00
init backend/cos: Add TencentCloud backend cos with lock (#22540) 2020-02-13 11:37:11 -05:00
local backend/local: refactor tests with modern state and default providers (#24524) 2020-04-06 09:24:23 -07:00
remote Add support for force pushing with the remote backend 2020-05-06 12:07:43 -04:00
remote-state Sync auth options with upstream openstack provider 2020-04-25 08:39:33 +02:00
backend.go backend: Allow certain commands to opt out of required variable checks 2019-10-10 10:07:01 -07:00
cli.go backend: Update interface and implementations for new config loader 2018-10-16 18:39:12 -07:00
nil.go Change backend.ValidateConfig to PrepareConfig 2019-02-25 18:37:20 -05:00
nil_test.go backend: introduce the backend set of interfaces 2017-01-26 14:33:49 -08:00
operation_type.go Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
operationtype_string.go stringer: Regenerate files with latest version 2019-05-13 15:34:27 +01:00
testing.go finish provider ModuleInstance replacement 2020-03-11 14:19:52 -04:00
unparsed_value.go Avoid leaking sensitive values in undeclared warnings 2019-11-05 17:32:57 -08:00
unparsed_value_test.go backend/local: Handle interactive prompts for variables in UI layer 2019-10-10 10:07:01 -07:00