terraform/backend
Alisdair McDiarmid 2d1976bbda clistate: Update clistate.Locker for command views
The clistate package includes a Locker interface which provides a simple
way for the local backend to lock and unlock state, while providing
feedback to the user if there is a delay while waiting for the lock.
Prior to this commit, the backend was responsible for initializing the
Locker, passing through direct access to the cli.Ui instance.

This structure prevented commands from implementing different
implementations of the state locker UI. In this commit, we:

- Move the responsibility of creating the appropriate Locker to the
  source of the Operation;
- Add the ability to set the context for a Locker via a WithContext
  method;
- Replace the Locker's cli.Ui and Colorize members with a StateLocker
  view;
- Implement views.StateLocker for human-readable UI;
- Update the Locker interface to return detailed diagnostics instead of
  errors, reducing its direct interactions with UI;
- Add a Timeout() method on Locker to allow the remote backend to
  continue to misuse the -lock-timeout flag to cancel pending runs.

When an Operation is created, the StateLocker field must now be
populated with an implementation of Locker. For situations where locking
is disabled, this can be a no-op locker.

This change has no significant effect on the operation of Terraform,
with the exception of slightly different formatting of errors when state
locking or unlocking fails.
2021-02-16 07:19:22 -05:00
..
init backend: remove deprecated atlas backend 2020-10-26 14:05:18 -04:00
local clistate: Update clistate.Locker for command views 2021-02-16 07:19:22 -05:00
remote clistate: Update clistate.Locker for command views 2021-02-16 07:19:22 -05:00
remote-state Grammar nit: "setup" as a verb should be spelled "set up" 2021-01-26 20:39:11 +01:00
backend.go clistate: Update clistate.Locker for command views 2021-02-16 07:19:22 -05:00
backend_test.go helper: deprecate pathorcontents 2020-10-08 08:42:16 -04:00
cli.go command: Use the new terminal.Streams object 2021-01-13 15:37:04 -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 remove LegacyProvider (#26433) 2020-10-05 08:33:49 -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