terraform/internal
Martin Atkins 51b0aee36c addrs: ModuleRegistryPackage for representing module registry packages
Previously we had a separation between ModuleSourceRemote and
ModulePackage as a way to represent within the type system that there's an
important difference between a module source address and a package address,
because module packages often contain multiple modules and so a
ModuleSourceRemote combines a ModulePackage with a subdirectory to
represent one specific module.

This commit applies that same strategy to ModuleSourceRegistry, creating
a new type ModuleRegistryPackage to represent the different sort of
package that we use for registry modules. Again, the main goal here is
to try to reflect the conceptual modelling more directly in the type
system so that we can more easily verify that uses of these different
address types are correct.

To make use of that, I've also lightly reworked initwd's module installer
to use addrs.ModuleRegistryPackage directly, instead of a string
representation thereof. This was in response to some earlier commits where
I found myself accidentally mixing up package addresses and source
addresses in the installRegistryModule method; with this new organization
those bugs would've been caught at compile time, rather than only at
unit and integration testing time.

While in the area anyway, I also took this opportunity to fix some
historical confusing names of fields in initwd.ModuleInstaller, to be
clearer that they are only for registry packages and not for all module
source address types.
2021-06-03 08:50:34 -07:00
..
addrs addrs: ModuleRegistryPackage for representing module registry packages 2021-06-03 08:50:34 -07:00
backend Merge pull request #28820 from hashicorp/radditude/refresh-error-message 2021-05-27 07:21:37 -07:00
builtin return diagnostics from provisioners 2021-05-19 11:24:54 -04:00
command Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
communicator Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
configs addrs: ModuleRegistryPackage for representing module registry packages 2021-06-03 08:50:34 -07:00
copy deprecate helper/copy 2020-10-08 08:42:16 -04:00
dag Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
depsfile Move addrs/ to internal/addrs/ 2021-05-17 14:09:07 -07:00
didyoumean didyoumean: move from "helper" to "internal" 2020-10-02 13:35:07 -07:00
e2e Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
earlyconfig Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
experiments Move experiments/ to internal/experiments/ 2021-05-17 14:09:07 -07:00
getmodules Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
getproviders addrs: Rename DefaultRegistryHost to DefaultProviderRegistryHost 2021-06-03 08:50:34 -07:00
grpcwrap Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
helper Grammar nit: "setup" as a verb should be spelled "set up" 2021-01-26 20:39:11 +01:00
httpclient Move httpclient/ to internal/httpclient/ 2021-05-17 14:09:07 -07:00
initwd addrs: ModuleRegistryPackage for representing module registry packages 2021-06-03 08:50:34 -07:00
instances Move addrs/ to internal/addrs/ 2021-05-17 14:09:07 -07:00
lang Move lang/ to internal/lang/ 2021-05-17 14:09:07 -07:00
legacy Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
logging monitor plugin std outputs for unexpected data 2021-05-13 16:57:36 -04:00
modsdir Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
moduledeps Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
moduletest Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
plans Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
plugin Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00
plugin6 Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
provider-simple Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
provider-simple-v6 Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
provider-terraform/main Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
providercache addrs: Rename DefaultRegistryHost to DefaultProviderRegistryHost 2021-06-03 08:50:34 -07:00
providers Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
provisioner-local-exec/main Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
provisioners Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
registry addrs: ModuleRegistryPackage for representing module registry packages 2021-06-03 08:50:34 -07:00
repl Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00
replacefile replacefile: don't create the temporary file in TMPDIR 2020-10-20 16:29:59 -07:00
states Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
terminal terminal: Helpers for doing fmt-ish operations on the streams 2021-02-12 11:24:13 -08:00
terraform addrs: Rename DefaultRegistryHost to DefaultProviderRegistryHost 2021-06-03 08:50:34 -07:00
tfdiags Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
tfplugin5 update to match new default branch name (#27909) 2021-02-24 13:36:47 -05:00
tfplugin6 update to match new default branch name (#27909) 2021-02-24 13:36:47 -05:00
typeexpr internal/typeexpr: staticcheck 2020-12-02 13:59:19 -05:00