cb0e20ca2b
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. |
||
---|---|---|
.. | ||
testdata | ||
backend.go | ||
backend_apply.go | ||
backend_apply_test.go | ||
backend_common.go | ||
backend_context.go | ||
backend_context_test.go | ||
backend_mock.go | ||
backend_plan.go | ||
backend_plan_test.go | ||
backend_state.go | ||
backend_state_test.go | ||
backend_test.go | ||
cli.go | ||
colorize.go | ||
remote_test.go | ||
testing.go |