opentofu/internal/getproviders
Martin Atkins 0b734a2803 command: Make provider installation interruptible
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.
2020-09-29 10:00:35 -07:00
..
testdata internal/getproviders: Allow basedir for local search to be symlink 2020-08-18 14:28:50 -07:00
doc.go internal/getproviders: Query a provider registry 2020-01-10 09:41:27 -08:00
errors.go command: Make provider installation interruptible 2020-09-29 10:00:35 -07:00
filesystem_mirror_source_test.go command: Make provider installation interruptible 2020-09-29 10:00:35 -07:00
filesystem_mirror_source.go command: Make provider installation interruptible 2020-09-29 10:00:35 -07:00
filesystem_search_test.go internal/getproviders: Allow basedir for local search to be symlink 2020-08-18 14:28:50 -07:00
filesystem_search.go internal/getproviders: Allow basedir for local search to be symlink 2020-08-18 14:28:50 -07:00
hash_test.go getproviders: Add a real type Hash for package hashes 2020-09-24 14:01:54 -07:00
hash.go getproviders: Prepare for having multiple valid hashes per package 2020-09-24 14:01:54 -07:00
http_mirror_source_test.go command: Make provider installation interruptible 2020-09-29 10:00:35 -07:00
http_mirror_source.go command: Make provider installation interruptible 2020-09-29 10:00:35 -07:00
legacy_lookup_test.go command: Make provider installation interruptible 2020-09-29 10:00:35 -07:00
legacy_lookup.go command: Make provider installation interruptible 2020-09-29 10:00:35 -07:00
memoize_source_test.go command: Make provider installation interruptible 2020-09-29 10:00:35 -07:00
memoize_source.go command: Make provider installation interruptible 2020-09-29 10:00:35 -07:00
mock_source.go command: Make provider installation interruptible 2020-09-29 10:00:35 -07:00
multi_source_test.go command: Make provider installation interruptible 2020-09-29 10:00:35 -07:00
multi_source.go command: Make provider installation interruptible 2020-09-29 10:00:35 -07:00
package_authentication_test.go getproviders: Prepare for having multiple valid hashes per package 2020-09-24 14:01:54 -07:00
package_authentication.go getproviders: Prepare for having multiple valid hashes per package 2020-09-24 14:01:54 -07:00
public_keys.go internal: Verify provider signatures on install 2020-04-17 13:57:19 -04:00
registry_client_test.go command: Make provider installation interruptible 2020-09-29 10:00:35 -07:00
registry_client.go command: Make provider installation interruptible 2020-09-29 10:00:35 -07:00
registry_source_test.go command: Make provider installation interruptible 2020-09-29 10:00:35 -07:00
registry_source.go command: Make provider installation interruptible 2020-09-29 10:00:35 -07:00
source.go command: Make provider installation interruptible 2020-09-29 10:00:35 -07:00
types.go getproviders: Prepare for having multiple valid hashes per package 2020-09-24 14:01:54 -07:00