terraform/internal/getproviders
Martin Atkins 4061cbed38 internal/getproviders: A new shared model for provider requirements
We've been using the models from the "moduledeps" package to represent our
provider dependencies everywhere since the idea of provider dependencies
was introduced in Terraform 0.10, but that model is not convenient to use
for any use-case other than the "terraform providers" command that needs
individual-module-level detail.

To make things easier for new codepaths working with the new-style
provider installer, here we introduce a new model type
getproviders.Requirements which is based on the type the new installer was
already taking as its input. We have new methods in the states, configs,
and earlyconfig packages to produce values of this type, and a helper
to merge Requirements together so we can combine config-derived and
state-derived requirements together during installation.

The advantage of this new model over the moduledeps one is that all of
recursive module walking is done up front and we produce a simple, flat
structure that is more convenient for the main use-cases of selecting
providers for installation and then finding providers in the local cache
to use them for other operations.

This new model is _not_ suitable for implementing "terraform providers"
because it does not retain module-specific requirement details. Therefore
we will likely keep using moduledeps for "terraform providers" for now,
and then possibly at a later time consider specializing the moduledeps
logic for only what "terraform providers" needs, because it seems to be
the only use-case that needs to retain that level of detail.
2020-03-27 09:01:32 -07:00
..
testdata/filesystem-mirror internal/getproviders: Initial implementation of FilesystemMirrorSource 2020-02-25 10:30:03 -05:00
doc.go internal/getproviders: Query a provider registry 2020-01-10 09:41:27 -08:00
errors.go internal/getproviders: Query a provider registry 2020-01-10 09:41:27 -08:00
filesystem_mirror_source.go internal/getproviders: Make local directory search a public API 2020-03-25 11:29:48 -07:00
filesystem_mirror_source_test.go internal/getproviders: Initial implementation of FilesystemMirrorSource 2020-02-25 10:30:03 -05:00
filesystem_search.go internal/getproviders: SearchLocalDirectory can handle symlinks 2020-03-25 13:50:00 -07:00
http_mirror_source.go internal/getproviders: Stub out the two mirror sources 2020-01-10 09:41:27 -08:00
legacy_lookup.go internal/getproviders: LookupLegacyProvider 2020-01-22 09:02:22 -08:00
legacy_lookup_test.go internal/getproviders: LookupLegacyProvider 2020-01-22 09:02:22 -08:00
memoize_source.go internal/getproviders: MemoizeSource for local caching of source responses 2020-01-10 09:41:27 -08:00
multi_source.go internal/getproviders: Exit early if MultiSource has no sources 2020-03-25 11:29:48 -07:00
registry_client.go internal/getproviders: Include Provider and Version in PackageMeta 2020-02-25 10:30:03 -05:00
registry_client_test.go internal/getproviders: LookupLegacyProvider 2020-01-22 09:02:22 -08:00
registry_source.go internal/getproviders: LookupLegacyProvider 2020-01-22 09:02:22 -08:00
registry_source_test.go build: Use Go 1.14 2020-03-04 13:26:50 -08:00
source.go internal/getproviders: Source interface for generalization 2020-01-10 09:41:27 -08:00
types.go internal/getproviders: A new shared model for provider requirements 2020-03-27 09:01:32 -07:00