|
|
|
|
@ -16,6 +16,7 @@ import (
|
|
|
|
|
cleanhttp "github.com/hashicorp/go-cleanhttp"
|
|
|
|
|
getter "github.com/hashicorp/go-getter"
|
|
|
|
|
multierror "github.com/hashicorp/go-multierror"
|
|
|
|
|
"github.com/mitchellh/cli"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Releases are located by parsing the html listing from releases.hashicorp.com.
|
|
|
|
|
@ -58,6 +59,8 @@ type ProviderInstaller struct {
|
|
|
|
|
|
|
|
|
|
// Skip checksum and signature verification
|
|
|
|
|
SkipVerify bool
|
|
|
|
|
|
|
|
|
|
Ui cli.Ui // Ui for output
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Get is part of an implementation of type Installer, and attempts to download
|
|
|
|
|
@ -116,6 +119,7 @@ func (i *ProviderInstaller) Get(provider string, req Constraints) (PluginMeta, e
|
|
|
|
|
|
|
|
|
|
log.Printf("[DEBUG] fetching provider info for %s version %s", provider, v)
|
|
|
|
|
if checkPlugin(url, i.PluginProtocolVersion) {
|
|
|
|
|
i.Ui.Info(fmt.Sprintf("- Downloading plugin for provider %q (%s)...", provider, v.String()))
|
|
|
|
|
log.Printf("[DEBUG] getting provider %q version %q at %s", provider, v, url)
|
|
|
|
|
err := getter.Get(i.Dir, url)
|
|
|
|
|
if err != nil {
|
|
|
|
|
@ -422,3 +426,7 @@ func getFile(url string) ([]byte, error) {
|
|
|
|
|
}
|
|
|
|
|
return data, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func GetReleaseHost() string {
|
|
|
|
|
return releaseHost
|
|
|
|
|
}
|
|
|
|
|
|