mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-30 10:47:14 -06:00
0b734a2803
In earlier commits we started to make the installation codepath context-aware so that it could be canceled in the event of a SIGINT, but we didn't complete wiring that through the API of the getproviders package. Here we make the getproviders.Source interface methods, along with some other functions that can make network requests, take a context.Context argument and act appropriately if that context is cancelled. The main providercache.Installer.EnsureProviderVersions method now also has some context-awareness so that it can abort its work early if its context reports any sort of error. That avoids waiting for the process to wind through all of the remaining iterations of the various loops, logging each request failure separately, and instead returns just a single aggregate "canceled" error. We can then set things up in the "terraform init" and "terraform providers mirror" commands so that the context will be cancelled if we get an interrupt signal, allowing provider installation to abort early while still atomically completing any local-side effects that may have started. |
||
---|---|---|
.. | ||
testdata | ||
doc.go | ||
errors.go | ||
filesystem_mirror_source_test.go | ||
filesystem_mirror_source.go | ||
filesystem_search_test.go | ||
filesystem_search.go | ||
hash_test.go | ||
hash.go | ||
http_mirror_source_test.go | ||
http_mirror_source.go | ||
legacy_lookup_test.go | ||
legacy_lookup.go | ||
memoize_source_test.go | ||
memoize_source.go | ||
mock_source.go | ||
multi_source_test.go | ||
multi_source.go | ||
package_authentication_test.go | ||
package_authentication.go | ||
public_keys.go | ||
registry_client_test.go | ||
registry_client.go | ||
registry_source_test.go | ||
registry_source.go | ||
source.go | ||
types.go |