opentofu/internal/providercache
Martin Atkins f5eac16b00 providercache: Factor out installation from the global cache dir
This is another step towards breaking the huge functions in this package
into smaller parts that have a clearer set of inputs and outputs.

For the moment the goal is to modify the existing code as little as
possible to make this easier to review, and so the new function
tryInstallPackageFromCacheDir has an unfortunately-large number of
arguments. Future refactoring can hopefully improve on this further.

One significant change to the structure of this code is that because it's
now in a separate function working on only one provider at a time we can
rely on early return for error handling, letting the caller be responsible
for collecting any errors into the "errs" map, and so we don't need quite
as much nesting as the previous code had.

This should not change the observable behavior in any way, which is
reinforced by there being no changes to any tests in this commit.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-01-24 15:11:05 -08:00
..
testdata Revert "Fixes #898: Replace hashicorp and terraform references" (#995) 2023-12-11 15:10:03 -05:00
cached_provider_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
cached_provider.go Another batch of minor typos (#1953) 2024-09-09 07:51:39 -04:00
dir_modify_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
dir_modify.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
dir_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
dir.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
doc.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
installer_events_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
installer_events.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
installer_test.go Warn user about provider version 0.0.0 (#2281) 2024-12-11 21:10:49 +04:00
installer.go providercache: Factor out installation from the global cache dir 2025-01-24 15:11:05 -08:00
package_install.go feat: add retry in provider install (#1255) 2024-04-01 12:41:18 -04:00