Skip to content

Commit

Permalink
Add provider version to useragent. (#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 nat-henderson committed Dec 6, 2018
1 parent 8d8607a commit 0a68056
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 @@ -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-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 0a68056

Please sign in to comment.