terraform/internal/backend/local
Martin Atkins 343279110a core: Graph walk loads plugin schemas opportunistically
Previously our graph walker expected to recieve a data structure
containing schemas for all of the provider and provisioner plugins used in
the configuration and state. That made sense back when
terraform.NewContext was responsible for loading all of the schemas before
taking any other action, but it no longer has that responsiblity.

Instead, we'll now make sure that the "contextPlugins" object reaches all
of the locations where we need schema -- many of which already had access
to that object anyway -- and then load the needed schemas just in time.

The contextPlugins object memoizes schema lookups, so we can safely call
it many times with the same provider address or provisioner type name and
know that it'll still only load each distinct plugin once per Context
object.

As of this commit, the Context.Schemas method is now a public interface
only and not used by logic in the "terraform" package at all. However,
that does leave us in a rather tenuous situation of relying on the fact
that all practical users of terraform.Context end up calling "Schemas" at
some point in order to verify that we have all of the expected versions
of plugins. That's a non-obvious implicit dependency, and so in subsequent
commits we'll gradually move all responsibility for verifying plugin
versions into the caller of terraform.NewContext, which'll heal a
long-standing architectural wart whereby the caller is responsible for
installing and locating the plugin executables but not for verifying that
what's installed is conforming to the current configuration and dependency
lock file.
2021-09-10 14:56:49 -07:00
..
testdata core: Functional-style API for terraform.Context 2021-08-30 13:59:14 -07:00
backend.go core: Functional-style API for terraform.Context 2021-08-30 13:59:14 -07:00
backend_apply.go core: Functional-style API for terraform.Context 2021-08-30 13:59:14 -07:00
backend_apply_test.go save apply diagnostics on backend failure 2021-05-17 17:22:04 -04:00
backend_local.go core: Functional-style API for terraform.Context 2021-08-30 13:59:14 -07:00
backend_local_test.go core: Functional-style API for terraform.Context 2021-08-30 13:59:14 -07:00
backend_plan.go core: Functional-style API for terraform.Context 2021-08-30 13:59:14 -07:00
backend_plan_test.go core: Graph walk loads plugin schemas opportunistically 2021-09-10 14:56:49 -07:00
backend_refresh.go core: Functional-style API for terraform.Context 2021-08-30 13:59:14 -07:00
backend_refresh_test.go Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00
backend_test.go core: Functional-style API for terraform.Context 2021-08-30 13:59:14 -07:00
cli.go Move backend/ to internal/backend/ 2021-05-17 14:09:07 -07:00
hook_state.go Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00
hook_state_test.go Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00
local_test.go Move backend/ to internal/backend/ 2021-05-17 14:09:07 -07:00
testing.go Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00