opentofu/internal/backend
Martin Atkins df578afd7e backend/local: Check dependency lock consistency before any operations
In historical versions of Terraform the responsibility to check this was
inside the terraform.NewContext function, along with various other
assorted concerns that made that function particularly complicated.

More recently, we reduced the responsibility of the "terraform" package
only to instantiating particular named plugins, assuming that its caller
is responsible for selecting appropriate versions of any providers that
_are_ external. However, until this commit we were just assuming that
"terraform init" had correctly selected appropriate plugins and recorded
them in the lock file, and so nothing was dealing with the problem of
ensuring that there haven't been any changes to the lock file or config
since the most recent "terraform init" which would cause us to need to
re-evaluate those decisions.

Part of the game here is to slightly extend the role of the dependency
locks object to also carry information about a subset of provider
addresses whose lock entries we're intentionally disregarding as part of
the various little edge-case features we have for overridding providers:
dev_overrides, "unmanaged providers", and the testing overrides in our
own unit tests. This is an in-memory-only annotation, never included in
the serialized plan files on disk.

I had originally intended to create a new package to encapsulate all of
this plugin-selection logic, including both the version constraint
checking here and also the handling of the provider factory functions, but
as an interim step I've just made version constraint consistency checks
the responsibility of the backend/local package, which means that we'll
always catch problems as part of preparing for local operations, while
not imposing these additional checks on commands that _don't_ run local
operations, such as "terraform apply" when in remote operations mode.
2021-10-01 14:43:58 -07:00
..
init Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
local backend/local: Check dependency lock consistency before any operations 2021-10-01 14:43:58 -07:00
remote backend/local: Check dependency lock consistency before any operations 2021-10-01 14:43:58 -07:00
remote-state Merge pull request #28838 from remilapeyre/consul-size-limit 2021-07-30 14:18:34 -04:00
backend_test.go 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
cli.go Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00
operation_type.go Move backend/ to internal/backend/ 2021-05-17 14:09:07 -07:00
operationtype_string.go Move backend/ to internal/backend/ 2021-05-17 14:09:07 -07:00
testing.go Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
unparsed_value_test.go configs: add ConstraintType to config.Variable 2021-09-13 08:51:32 -04:00
unparsed_value.go Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00