Add provider version to useragent. (#2442)

<!-- This change is generated by MagicModules. -->
/cc @rileykarson
This commit is contained in:
The Magician 2018-11-13 16:01:45 -08:00 committed by Nathan McKinley
parent ff16c8f4e0
commit 5533075029

View File

@ -10,7 +10,8 @@ import (
"github.com/hashicorp/terraform/helper/logging"
"github.com/hashicorp/terraform/helper/pathorcontents"
"github.com/hashicorp/terraform/version"
"github.com/hashicorp/terraform/httpclient"
"github.com/terraform-providers/terraform-provider-google/version"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
@ -154,9 +155,10 @@ func (c *Config) loadAndValidate() error {
client.Transport = logging.NewTransport("Google", client.Transport)
projectURL := "https://www.terraform.io"
userAgent := fmt.Sprintf("Terraform/%s (+%s)",
version.String(), projectURL)
terraformVersion := httpclient.UserAgentString()
providerVersion := fmt.Sprintf("terraform-provider-google/%s", version.ProviderVersion)
terraformWebsite := "(+https://www.terraform.io)"
userAgent := fmt.Sprintf("%s %s %s", terraformVersion, terraformWebsite, providerVersion)
c.client = client
c.userAgent = userAgent