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 | ||
cached_provider.go | ||
cached_provider_test.go | ||
dir.go | ||
dir_modify.go | ||
dir_modify_test.go | ||
dir_test.go | ||
doc.go | ||
installer.go | ||
installer_events.go | ||
installer_test.go | ||
lock_file.go | ||
package_install.go |