terraform/internal/initwd
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
..
testdata initwd: Error message for local paths escaping module packages 2021-05-27 11:00:43 -07:00
doc.go
from_module.go Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
from_module_test.go initwd: Fix registry acceptance tests for upstream registry changes 2021-06-03 08:50:34 -07:00
load_config.go Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
module_install.go addrs: ModuleRegistryPackage for representing module registry packages 2021-06-03 08:50:34 -07:00
module_install_hooks.go
module_install_test.go addrs: ModuleRegistryPackage for representing module registry packages 2021-06-03 08:50:34 -07:00
testing.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00