Replace import paths & set UA string where necessary
This commit is contained in:
parent
047733d20c
commit
32f9722d9d
|
@ -5,8 +5,8 @@ package init
|
||||||
import (
|
import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"github.com/hashicorp/terraform-svchost/disco"
|
||||||
"github.com/hashicorp/terraform/backend"
|
"github.com/hashicorp/terraform/backend"
|
||||||
"github.com/hashicorp/terraform/svchost/disco"
|
|
||||||
"github.com/hashicorp/terraform/tfdiags"
|
"github.com/hashicorp/terraform/tfdiags"
|
||||||
"github.com/zclconf/go-cty/cty"
|
"github.com/zclconf/go-cty/cty"
|
||||||
|
|
||||||
|
|
|
@ -14,12 +14,12 @@ import (
|
||||||
|
|
||||||
tfe "github.com/hashicorp/go-tfe"
|
tfe "github.com/hashicorp/go-tfe"
|
||||||
version "github.com/hashicorp/go-version"
|
version "github.com/hashicorp/go-version"
|
||||||
|
"github.com/hashicorp/terraform-svchost"
|
||||||
|
"github.com/hashicorp/terraform-svchost/disco"
|
||||||
"github.com/hashicorp/terraform/backend"
|
"github.com/hashicorp/terraform/backend"
|
||||||
"github.com/hashicorp/terraform/configs/configschema"
|
"github.com/hashicorp/terraform/configs/configschema"
|
||||||
"github.com/hashicorp/terraform/state"
|
"github.com/hashicorp/terraform/state"
|
||||||
"github.com/hashicorp/terraform/state/remote"
|
"github.com/hashicorp/terraform/state/remote"
|
||||||
"github.com/hashicorp/terraform/svchost"
|
|
||||||
"github.com/hashicorp/terraform/svchost/disco"
|
|
||||||
"github.com/hashicorp/terraform/terraform"
|
"github.com/hashicorp/terraform/terraform"
|
||||||
"github.com/hashicorp/terraform/tfdiags"
|
"github.com/hashicorp/terraform/tfdiags"
|
||||||
tfversion "github.com/hashicorp/terraform/version"
|
tfversion "github.com/hashicorp/terraform/version"
|
||||||
|
|
|
@ -5,8 +5,8 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/hashicorp/terraform-svchost/disco"
|
||||||
"github.com/hashicorp/terraform/backend"
|
"github.com/hashicorp/terraform/backend"
|
||||||
"github.com/hashicorp/terraform/svchost/disco"
|
|
||||||
"github.com/hashicorp/terraform/version"
|
"github.com/hashicorp/terraform/version"
|
||||||
"github.com/zclconf/go-cty/cty"
|
"github.com/zclconf/go-cty/cty"
|
||||||
|
|
||||||
|
|
|
@ -10,16 +10,18 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
tfe "github.com/hashicorp/go-tfe"
|
tfe "github.com/hashicorp/go-tfe"
|
||||||
|
"github.com/hashicorp/terraform-svchost"
|
||||||
|
"github.com/hashicorp/terraform-svchost/auth"
|
||||||
|
"github.com/hashicorp/terraform-svchost/disco"
|
||||||
"github.com/hashicorp/terraform/backend"
|
"github.com/hashicorp/terraform/backend"
|
||||||
"github.com/hashicorp/terraform/configs"
|
"github.com/hashicorp/terraform/configs"
|
||||||
"github.com/hashicorp/terraform/configs/configschema"
|
"github.com/hashicorp/terraform/configs/configschema"
|
||||||
|
"github.com/hashicorp/terraform/httpclient"
|
||||||
"github.com/hashicorp/terraform/providers"
|
"github.com/hashicorp/terraform/providers"
|
||||||
"github.com/hashicorp/terraform/state/remote"
|
"github.com/hashicorp/terraform/state/remote"
|
||||||
"github.com/hashicorp/terraform/svchost"
|
|
||||||
"github.com/hashicorp/terraform/svchost/auth"
|
|
||||||
"github.com/hashicorp/terraform/svchost/disco"
|
|
||||||
"github.com/hashicorp/terraform/terraform"
|
"github.com/hashicorp/terraform/terraform"
|
||||||
"github.com/hashicorp/terraform/tfdiags"
|
"github.com/hashicorp/terraform/tfdiags"
|
||||||
|
"github.com/hashicorp/terraform/version"
|
||||||
"github.com/mitchellh/cli"
|
"github.com/mitchellh/cli"
|
||||||
"github.com/zclconf/go-cty/cty"
|
"github.com/zclconf/go-cty/cty"
|
||||||
|
|
||||||
|
@ -268,6 +270,7 @@ func testDisco(s *httptest.Server) *disco.Disco {
|
||||||
"versions.v1": fmt.Sprintf("%s/v1/versions/", s.URL),
|
"versions.v1": fmt.Sprintf("%s/v1/versions/", s.URL),
|
||||||
}
|
}
|
||||||
d := disco.NewWithCredentialsSource(credsSrc)
|
d := disco.NewWithCredentialsSource(credsSrc)
|
||||||
|
d.SetUserAgent(httpclient.TerraformUserAgent(version.String()))
|
||||||
|
|
||||||
d.ForceHostServices(svchost.Hostname(defaultHostname), services)
|
d.ForceHostServices(svchost.Hostname(defaultHostname), services)
|
||||||
d.ForceHostServices(svchost.Hostname("localhost"), services)
|
d.ForceHostServices(svchost.Hostname("localhost"), services)
|
||||||
|
|
|
@ -17,7 +17,7 @@ import (
|
||||||
|
|
||||||
"github.com/hashicorp/hcl"
|
"github.com/hashicorp/hcl"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform/svchost"
|
"github.com/hashicorp/terraform-svchost"
|
||||||
"github.com/hashicorp/terraform/tfdiags"
|
"github.com/hashicorp/terraform/tfdiags"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -12,10 +12,10 @@ import (
|
||||||
"github.com/zclconf/go-cty/cty"
|
"github.com/zclconf/go-cty/cty"
|
||||||
ctyjson "github.com/zclconf/go-cty/cty/json"
|
ctyjson "github.com/zclconf/go-cty/cty/json"
|
||||||
|
|
||||||
|
"github.com/hashicorp/terraform-svchost"
|
||||||
|
svcauth "github.com/hashicorp/terraform-svchost/auth"
|
||||||
"github.com/hashicorp/terraform/configs/hcl2shim"
|
"github.com/hashicorp/terraform/configs/hcl2shim"
|
||||||
pluginDiscovery "github.com/hashicorp/terraform/plugin/discovery"
|
pluginDiscovery "github.com/hashicorp/terraform/plugin/discovery"
|
||||||
"github.com/hashicorp/terraform/svchost"
|
|
||||||
svcauth "github.com/hashicorp/terraform/svchost/auth"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// credentialsConfigFile returns the path for the special configuration file
|
// credentialsConfigFile returns the path for the special configuration file
|
||||||
|
|
|
@ -10,8 +10,8 @@ import (
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"github.com/zclconf/go-cty/cty"
|
"github.com/zclconf/go-cty/cty"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform/svchost"
|
"github.com/hashicorp/terraform-svchost"
|
||||||
svcauth "github.com/hashicorp/terraform/svchost/auth"
|
svcauth "github.com/hashicorp/terraform-svchost/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCredentialsForHost(t *testing.T) {
|
func TestCredentialsForHost(t *testing.T) {
|
||||||
|
|
|
@ -13,11 +13,11 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/hashicorp/terraform-svchost"
|
||||||
|
svcauth "github.com/hashicorp/terraform-svchost/auth"
|
||||||
|
"github.com/hashicorp/terraform-svchost/disco"
|
||||||
"github.com/hashicorp/terraform/command/cliconfig"
|
"github.com/hashicorp/terraform/command/cliconfig"
|
||||||
"github.com/hashicorp/terraform/httpclient"
|
"github.com/hashicorp/terraform/httpclient"
|
||||||
"github.com/hashicorp/terraform/svchost"
|
|
||||||
svcauth "github.com/hashicorp/terraform/svchost/auth"
|
|
||||||
"github.com/hashicorp/terraform/svchost/disco"
|
|
||||||
"github.com/hashicorp/terraform/tfdiags"
|
"github.com/hashicorp/terraform/tfdiags"
|
||||||
|
|
||||||
uuid "github.com/hashicorp/go-uuid"
|
uuid "github.com/hashicorp/go-uuid"
|
||||||
|
|
|
@ -12,11 +12,13 @@ import (
|
||||||
|
|
||||||
"github.com/mitchellh/cli"
|
"github.com/mitchellh/cli"
|
||||||
|
|
||||||
|
"github.com/hashicorp/terraform-svchost"
|
||||||
|
"github.com/hashicorp/terraform-svchost/disco"
|
||||||
"github.com/hashicorp/terraform/command/cliconfig"
|
"github.com/hashicorp/terraform/command/cliconfig"
|
||||||
oauthserver "github.com/hashicorp/terraform/command/testdata/login-oauth-server"
|
oauthserver "github.com/hashicorp/terraform/command/testdata/login-oauth-server"
|
||||||
"github.com/hashicorp/terraform/command/webbrowser"
|
"github.com/hashicorp/terraform/command/webbrowser"
|
||||||
"github.com/hashicorp/terraform/svchost"
|
"github.com/hashicorp/terraform/httpclient"
|
||||||
"github.com/hashicorp/terraform/svchost/disco"
|
"github.com/hashicorp/terraform/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestLogin(t *testing.T) {
|
func TestLogin(t *testing.T) {
|
||||||
|
@ -43,6 +45,7 @@ func TestLogin(t *testing.T) {
|
||||||
browserLauncher := webbrowser.NewMockLauncher(ctx)
|
browserLauncher := webbrowser.NewMockLauncher(ctx)
|
||||||
creds := cliconfig.EmptyCredentialsSourceForTests(filepath.Join(workDir, "credentials.tfrc.json"))
|
creds := cliconfig.EmptyCredentialsSourceForTests(filepath.Join(workDir, "credentials.tfrc.json"))
|
||||||
svcs := disco.NewWithCredentialsSource(creds)
|
svcs := disco.NewWithCredentialsSource(creds)
|
||||||
|
svcs.SetUserAgent(httpclient.TerraformUserAgent(version.String()))
|
||||||
|
|
||||||
inputBuf := &bytes.Buffer{}
|
inputBuf := &bytes.Buffer{}
|
||||||
ui.InputReader = inputBuf
|
ui.InputReader = inputBuf
|
||||||
|
|
|
@ -14,6 +14,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/hashicorp/terraform-svchost/disco"
|
||||||
"github.com/hashicorp/terraform/addrs"
|
"github.com/hashicorp/terraform/addrs"
|
||||||
"github.com/hashicorp/terraform/backend"
|
"github.com/hashicorp/terraform/backend"
|
||||||
"github.com/hashicorp/terraform/backend/local"
|
"github.com/hashicorp/terraform/backend/local"
|
||||||
|
@ -24,7 +25,6 @@ import (
|
||||||
"github.com/hashicorp/terraform/helper/wrappedstreams"
|
"github.com/hashicorp/terraform/helper/wrappedstreams"
|
||||||
"github.com/hashicorp/terraform/providers"
|
"github.com/hashicorp/terraform/providers"
|
||||||
"github.com/hashicorp/terraform/provisioners"
|
"github.com/hashicorp/terraform/provisioners"
|
||||||
"github.com/hashicorp/terraform/svchost/disco"
|
|
||||||
"github.com/hashicorp/terraform/terraform"
|
"github.com/hashicorp/terraform/terraform"
|
||||||
"github.com/hashicorp/terraform/tfdiags"
|
"github.com/hashicorp/terraform/tfdiags"
|
||||||
"github.com/mitchellh/cli"
|
"github.com/mitchellh/cli"
|
||||||
|
|
|
@ -6,13 +6,13 @@ import (
|
||||||
|
|
||||||
"github.com/mitchellh/cli"
|
"github.com/mitchellh/cli"
|
||||||
|
|
||||||
|
"github.com/hashicorp/terraform-svchost"
|
||||||
|
"github.com/hashicorp/terraform-svchost/auth"
|
||||||
|
"github.com/hashicorp/terraform-svchost/disco"
|
||||||
"github.com/hashicorp/terraform/command"
|
"github.com/hashicorp/terraform/command"
|
||||||
"github.com/hashicorp/terraform/command/cliconfig"
|
"github.com/hashicorp/terraform/command/cliconfig"
|
||||||
"github.com/hashicorp/terraform/command/webbrowser"
|
"github.com/hashicorp/terraform/command/webbrowser"
|
||||||
pluginDiscovery "github.com/hashicorp/terraform/plugin/discovery"
|
pluginDiscovery "github.com/hashicorp/terraform/plugin/discovery"
|
||||||
"github.com/hashicorp/terraform/svchost"
|
|
||||||
"github.com/hashicorp/terraform/svchost/auth"
|
|
||||||
"github.com/hashicorp/terraform/svchost/disco"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// runningInAutomationEnvName gives the name of an environment variable that
|
// runningInAutomationEnvName gives the name of an environment variable that
|
||||||
|
|
|
@ -4,9 +4,9 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
|
"github.com/hashicorp/terraform-svchost/disco"
|
||||||
"github.com/hashicorp/terraform/configs"
|
"github.com/hashicorp/terraform/configs"
|
||||||
"github.com/hashicorp/terraform/registry"
|
"github.com/hashicorp/terraform/registry"
|
||||||
"github.com/hashicorp/terraform/svchost/disco"
|
|
||||||
"github.com/spf13/afero"
|
"github.com/spf13/afero"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
|
"github.com/hashicorp/terraform-svchost/disco"
|
||||||
"github.com/hashicorp/terraform/internal/modsdir"
|
"github.com/hashicorp/terraform/internal/modsdir"
|
||||||
"github.com/hashicorp/terraform/registry"
|
"github.com/hashicorp/terraform/registry"
|
||||||
"github.com/hashicorp/terraform/svchost/disco"
|
|
||||||
"github.com/spf13/afero"
|
"github.com/spf13/afero"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
5
main.go
5
main.go
|
@ -12,9 +12,11 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/hashicorp/go-plugin"
|
"github.com/hashicorp/go-plugin"
|
||||||
|
"github.com/hashicorp/terraform-svchost/disco"
|
||||||
"github.com/hashicorp/terraform/command/format"
|
"github.com/hashicorp/terraform/command/format"
|
||||||
"github.com/hashicorp/terraform/helper/logging"
|
"github.com/hashicorp/terraform/helper/logging"
|
||||||
"github.com/hashicorp/terraform/svchost/disco"
|
"github.com/hashicorp/terraform/httpclient"
|
||||||
|
"github.com/hashicorp/terraform/version"
|
||||||
"github.com/mattn/go-colorable"
|
"github.com/mattn/go-colorable"
|
||||||
"github.com/mattn/go-shellwords"
|
"github.com/mattn/go-shellwords"
|
||||||
"github.com/mitchellh/cli"
|
"github.com/mitchellh/cli"
|
||||||
|
@ -159,6 +161,7 @@ func wrappedMain() int {
|
||||||
// object checks that and just acts as though no credentials are present.
|
// object checks that and just acts as though no credentials are present.
|
||||||
}
|
}
|
||||||
services := disco.NewWithCredentialsSource(credsSrc)
|
services := disco.NewWithCredentialsSource(credsSrc)
|
||||||
|
services.SetUserAgent(httpclient.TerraformUserAgent(version.String()))
|
||||||
|
|
||||||
// Initialize the backends.
|
// Initialize the backends.
|
||||||
backendInit.Init(services)
|
backendInit.Init(services)
|
||||||
|
|
|
@ -16,12 +16,12 @@ import (
|
||||||
"github.com/hashicorp/errwrap"
|
"github.com/hashicorp/errwrap"
|
||||||
getter "github.com/hashicorp/go-getter"
|
getter "github.com/hashicorp/go-getter"
|
||||||
multierror "github.com/hashicorp/go-multierror"
|
multierror "github.com/hashicorp/go-multierror"
|
||||||
|
"github.com/hashicorp/terraform-svchost/disco"
|
||||||
"github.com/hashicorp/terraform/addrs"
|
"github.com/hashicorp/terraform/addrs"
|
||||||
"github.com/hashicorp/terraform/httpclient"
|
"github.com/hashicorp/terraform/httpclient"
|
||||||
"github.com/hashicorp/terraform/registry"
|
"github.com/hashicorp/terraform/registry"
|
||||||
"github.com/hashicorp/terraform/registry/regsrc"
|
"github.com/hashicorp/terraform/registry/regsrc"
|
||||||
"github.com/hashicorp/terraform/registry/response"
|
"github.com/hashicorp/terraform/registry/response"
|
||||||
"github.com/hashicorp/terraform/svchost/disco"
|
|
||||||
"github.com/hashicorp/terraform/tfdiags"
|
"github.com/hashicorp/terraform/tfdiags"
|
||||||
tfversion "github.com/hashicorp/terraform/version"
|
tfversion "github.com/hashicorp/terraform/version"
|
||||||
"github.com/mitchellh/cli"
|
"github.com/mitchellh/cli"
|
||||||
|
|
|
@ -17,11 +17,13 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/hashicorp/terraform-svchost"
|
||||||
|
"github.com/hashicorp/terraform-svchost/disco"
|
||||||
"github.com/hashicorp/terraform/addrs"
|
"github.com/hashicorp/terraform/addrs"
|
||||||
|
"github.com/hashicorp/terraform/httpclient"
|
||||||
"github.com/hashicorp/terraform/registry"
|
"github.com/hashicorp/terraform/registry"
|
||||||
"github.com/hashicorp/terraform/registry/response"
|
"github.com/hashicorp/terraform/registry/response"
|
||||||
"github.com/hashicorp/terraform/svchost"
|
"github.com/hashicorp/terraform/version"
|
||||||
"github.com/hashicorp/terraform/svchost/disco"
|
|
||||||
"github.com/mitchellh/cli"
|
"github.com/mitchellh/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -741,6 +743,7 @@ func Disco(s *httptest.Server) *disco.Disco {
|
||||||
"providers.v1": fmt.Sprintf("%s/v1/providers", s.URL),
|
"providers.v1": fmt.Sprintf("%s/v1/providers", s.URL),
|
||||||
}
|
}
|
||||||
d := disco.New()
|
d := disco.New()
|
||||||
|
d.SetUserAgent(httpclient.TerraformUserAgent(version.String()))
|
||||||
|
|
||||||
d.ForceHostServices(svchost.Hostname("registry.terraform.io"), services)
|
d.ForceHostServices(svchost.Hostname("registry.terraform.io"), services)
|
||||||
d.ForceHostServices(svchost.Hostname("localhost"), services)
|
d.ForceHostServices(svchost.Hostname("localhost"), services)
|
||||||
|
|
|
@ -11,11 +11,11 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/hashicorp/terraform-svchost"
|
||||||
|
"github.com/hashicorp/terraform-svchost/disco"
|
||||||
"github.com/hashicorp/terraform/httpclient"
|
"github.com/hashicorp/terraform/httpclient"
|
||||||
"github.com/hashicorp/terraform/registry/regsrc"
|
"github.com/hashicorp/terraform/registry/regsrc"
|
||||||
"github.com/hashicorp/terraform/registry/response"
|
"github.com/hashicorp/terraform/registry/response"
|
||||||
"github.com/hashicorp/terraform/svchost"
|
|
||||||
"github.com/hashicorp/terraform/svchost/disco"
|
|
||||||
"github.com/hashicorp/terraform/version"
|
"github.com/hashicorp/terraform/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -52,6 +52,8 @@ func NewClient(services *disco.Disco, client *http.Client) *Client {
|
||||||
|
|
||||||
services.Transport = client.Transport
|
services.Transport = client.Transport
|
||||||
|
|
||||||
|
services.SetUserAgent(httpclient.TerraformUserAgent(version.String()))
|
||||||
|
|
||||||
return &Client{
|
return &Client{
|
||||||
client: client,
|
client: client,
|
||||||
services: services,
|
services: services,
|
||||||
|
|
|
@ -7,9 +7,11 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
version "github.com/hashicorp/go-version"
|
version "github.com/hashicorp/go-version"
|
||||||
|
"github.com/hashicorp/terraform-svchost/disco"
|
||||||
|
"github.com/hashicorp/terraform/httpclient"
|
||||||
"github.com/hashicorp/terraform/registry/regsrc"
|
"github.com/hashicorp/terraform/registry/regsrc"
|
||||||
"github.com/hashicorp/terraform/registry/test"
|
"github.com/hashicorp/terraform/registry/test"
|
||||||
"github.com/hashicorp/terraform/svchost/disco"
|
tfversion "github.com/hashicorp/terraform/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestLookupModuleVersions(t *testing.T) {
|
func TestLookupModuleVersions(t *testing.T) {
|
||||||
|
@ -136,6 +138,7 @@ func TestAccLookupModuleVersions(t *testing.T) {
|
||||||
t.Skip()
|
t.Skip()
|
||||||
}
|
}
|
||||||
regDisco := disco.New()
|
regDisco := disco.New()
|
||||||
|
regDisco.SetUserAgent(httpclient.TerraformUserAgent(tfversion.String()))
|
||||||
|
|
||||||
// test with and without a hostname
|
// test with and without a hostname
|
||||||
for _, src := range []string{
|
for _, src := range []string{
|
||||||
|
|
|
@ -3,8 +3,8 @@ package registry
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/hashicorp/terraform-svchost/disco"
|
||||||
"github.com/hashicorp/terraform/registry/regsrc"
|
"github.com/hashicorp/terraform/registry/regsrc"
|
||||||
"github.com/hashicorp/terraform/svchost/disco"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type errModuleNotFound struct {
|
type errModuleNotFound struct {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform/svchost"
|
"github.com/hashicorp/terraform-svchost"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform/svchost"
|
"github.com/hashicorp/terraform-svchost"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform/svchost"
|
"github.com/hashicorp/terraform-svchost"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -12,11 +12,13 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
version "github.com/hashicorp/go-version"
|
version "github.com/hashicorp/go-version"
|
||||||
|
"github.com/hashicorp/terraform-svchost"
|
||||||
|
"github.com/hashicorp/terraform-svchost/auth"
|
||||||
|
"github.com/hashicorp/terraform-svchost/disco"
|
||||||
|
"github.com/hashicorp/terraform/httpclient"
|
||||||
"github.com/hashicorp/terraform/registry/regsrc"
|
"github.com/hashicorp/terraform/registry/regsrc"
|
||||||
"github.com/hashicorp/terraform/registry/response"
|
"github.com/hashicorp/terraform/registry/response"
|
||||||
"github.com/hashicorp/terraform/svchost"
|
tfversion "github.com/hashicorp/terraform/version"
|
||||||
"github.com/hashicorp/terraform/svchost/auth"
|
|
||||||
"github.com/hashicorp/terraform/svchost/disco"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Disco return a *disco.Disco mapping registry.terraform.io, localhost,
|
// Disco return a *disco.Disco mapping registry.terraform.io, localhost,
|
||||||
|
@ -29,6 +31,7 @@ func Disco(s *httptest.Server) *disco.Disco {
|
||||||
"providers.v1": fmt.Sprintf("%s/v1/providers", s.URL),
|
"providers.v1": fmt.Sprintf("%s/v1/providers", s.URL),
|
||||||
}
|
}
|
||||||
d := disco.NewWithCredentialsSource(credsSrc)
|
d := disco.NewWithCredentialsSource(credsSrc)
|
||||||
|
d.SetUserAgent(httpclient.TerraformUserAgent(tfversion.String()))
|
||||||
|
|
||||||
d.ForceHostServices(svchost.Hostname("registry.terraform.io"), services)
|
d.ForceHostServices(svchost.Hostname("registry.terraform.io"), services)
|
||||||
d.ForceHostServices(svchost.Hostname("localhost"), services)
|
d.ForceHostServices(svchost.Hostname("localhost"), services)
|
||||||
|
|
Loading…
Reference in New Issue