mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-19 17:59:05 -05:00
This registry client code is very, very old and in particular predates the creation of the separate "registry-address" library and OpenTofu's own "package addrs", so it had its own type for representing module addresses. It also had some historical confusion about the difference between a module package and a module, which meant the code was pretty unclear about whether it was dealing in module packages or module source addresses: in practice we were always leaving the "Submodule" field empty because the registry client isn't the component responsible for dealing with modules in package subdirectories, but this made the code confusing to read and maintain. This change therefore removes the legacy package regsrc altogether and adopts regaddr.ModulePackage as the canonical representation of registry module package addresses. This therefore makes the module registry client agree with the module installer about what vocabulary types we're using, and so we no longer need shim code for converting between the two representations. To make it abundantly clear that the registry client deals only in package addresses, the client methods and arguments are renamed to reflect that, and the callers updated to match. While in the area anyway I also adjusted a few others things that were not aligned with our modern conventions, but tried to keep it limited to relatively localized changes for ease of review. There's probably room for more improvement here in subsequent commits. Signed-off-by: Martin Atkins <mart@degeneration.co.uk>