Skip to content

Commit

Permalink
Add provider version to useragent. (hashicorp#117)
Browse files Browse the repository at this point in the history
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
  • Loading branch information
modular-magician authored and rileykarson committed Nov 14, 2018
1 parent e322207 commit 9eca81e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions google-beta/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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-beta/version"

"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
Expand Down Expand Up @@ -158,9 +159,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-beta/%s", version.ProviderVersion)
terraformWebsite := "(+https://www.terraform.io)"
userAgent := fmt.Sprintf("%s %s %s", terraformVersion, terraformWebsite, providerVersion)

c.client = client
c.userAgent = userAgent
Expand Down

0 comments on commit 9eca81e

Please sign in to comment.