terraform/backend/local
Martin Atkins c6a7d080d9 core: Generalize the idea of a "plan mode", vs just destroy flag
Previously there were only two planning modes: normal mode and destroy
mode. In that context it made sense for these to be distinguished only by
a boolean flag.

We're now getting ready to add our third mode, "refresh only". This
establishes the idea that planning can be done in one of a number of
mutually-exclusive "modes", which are related to but separate from the
various other options that serve as modifiers for the plan operation.

This commit only introduces the new plans.Mode type and replaces the
existing "destroy" flag with a variable of that type. This doesn't cause
any change in effective behavior because Terraform Core still supports
only NormalMode and DestroyMode, with NewContext rejecting an attempt to
create a RefreshMode context for now.

It is in retrospect a little odd that the "destroy" flag was part of
ContextOpts rather than just an argument to the Plan method, but
refactoring that would be too invasive a change for right now so we'll
leave this as a field of the context for now and save revisiting that for
another day.
2021-04-27 08:23:54 -07:00
..
testdata cli: Move resource count code to command package 2021-01-29 15:29:35 -05:00
backend.go backend/local: Replace CLI with view instance 2021-02-18 12:08:08 -05:00
backend_apply.go command: Add a newline before confirming apply 2021-04-14 09:30:49 -04:00
backend_apply_test.go backend: Replace ShowDiagnostics with view.Diagnostics 2021-02-25 11:26:05 -05:00
backend_local.go core: Generalize the idea of a "plan mode", vs just destroy flag 2021-04-27 08:23:54 -07:00
backend_local_test.go clistate: Update clistate.Locker for command views 2021-02-16 07:19:22 -05:00
backend_plan.go backend: Replace ShowDiagnostics with view.Diagnostics 2021-02-25 11:26:05 -05:00
backend_plan_test.go backend: Replace ShowDiagnostics with view.Diagnostics 2021-02-25 11:26:05 -05:00
backend_refresh.go backend: Replace ShowDiagnostics with view.Diagnostics 2021-02-25 11:26:05 -05:00
backend_refresh_test.go backend: Replace ShowDiagnostics with view.Diagnostics 2021-02-25 11:26:05 -05:00
backend_test.go Implement the remote enhanced backend 2018-11-06 16:29:46 +01:00
cli.go backend/local: Replace CLI with view instance 2021-02-18 12:08:08 -05:00
hook_state.go state: remove deprecated state package (#25490) 2020-08-11 11:43:01 -04:00
hook_state_test.go state: remove deprecated state package (#25490) 2020-08-11 11:43:01 -04:00
local_test.go use a single log writer 2020-10-19 14:29:54 -04:00
testing.go backend: Replace ShowDiagnostics with view.Diagnostics 2021-02-25 11:26:05 -05:00