terraform/internal/backend/remote
Martin Atkins bee7403f3e command/workspace_delete: Allow deleting a workspace with empty husks
Previously we would reject attempts to delete a workspace if its state
contained any resources at all, even if none of the resources had any
resource instance objects associated with it.

Nowadays there isn't any situation where the normal Terraform workflow
will leave behind resource husks, and so this isn't as problematic as it
might've been in the v0.12 era, but nonetheless what we actually care
about for this check is whether there might be any remote objects that
this state is tracking, and for that it's more precise to look for
non-nil resource instance objects, rather than whole resources.

This also includes some adjustments to our error messaging to give more
information about the problem and to use terminology more consistent with
how we currently talk about this situation in our documentation and
elsewhere in the UI.

We were also using the old State.HasResources method as part of some of
our tests. I considered preserving it to avoid changing the behavior of
those tests, but the new check seemed close enough to the intent of those
tests that it wasn't worth maintaining this method that wouldn't be used
in any main code anymore. I've therefore updated those tests to use
the new HasResourceInstanceObjects method instead.
2021-10-13 13:54:11 -07:00
..
testdata Move backend/ to internal/backend/ 2021-05-17 14:09:07 -07:00
backend.go backend/local: Check dependency lock consistency before any operations 2021-10-01 14:43:58 -07:00
backend_apply.go backend: Remove Operation.Parallelism field 2021-09-14 10:35:08 -07:00
backend_apply_test.go command/workspace_delete: Allow deleting a workspace with empty husks 2021-10-13 13:54:11 -07:00
backend_common.go Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00
backend_context.go core: Functional-style API for terraform.Context 2021-08-30 13:59:14 -07:00
backend_context_test.go core: Functional-style API for terraform.Context 2021-08-30 13:59:14 -07:00
backend_mock.go backend/remote: test new options and modes 2021-05-18 15:35:37 -07:00
backend_plan.go backend: Remove Operation.Parallelism field 2021-09-14 10:35:08 -07:00
backend_plan_test.go backend/local: Check dependency lock consistency before any operations 2021-10-01 14:43:58 -07:00
backend_state.go Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
backend_state_test.go Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
backend_test.go backend/remote: Support interop from 0.14 to 1.1 2021-09-24 09:26:09 -04:00
cli.go Move backend/ to internal/backend/ 2021-05-17 14:09:07 -07:00
colorize.go Move backend/ to internal/backend/ 2021-05-17 14:09:07 -07:00
remote_test.go Move backend/ to internal/backend/ 2021-05-17 14:09:07 -07:00
testing.go backend/remote: test new options and modes 2021-05-18 15:35:37 -07:00