Merge pull request #3554 from lwander/f-gcp-version
provider/google: Accurate Terraform Version
This commit is contained in:
commit
c0bf7aecb3
|
@ -10,8 +10,7 @@ import (
|
|||
"runtime"
|
||||
"strings"
|
||||
|
||||
// TODO(dcunnin): Use version code from version.go
|
||||
// "github.com/hashicorp/terraform"
|
||||
"github.com/hashicorp/terraform/terraform"
|
||||
"golang.org/x/oauth2"
|
||||
"golang.org/x/oauth2/google"
|
||||
"golang.org/x/oauth2/jwt"
|
||||
|
@ -113,13 +112,11 @@ func (c *Config) loadAndValidate() error {
|
|||
}
|
||||
}
|
||||
|
||||
// Build UserAgent
|
||||
versionString := "0.0.0"
|
||||
// TODO(dcunnin): Use Terraform's version code from version.go
|
||||
// versionString := main.Version
|
||||
// if main.VersionPrerelease != "" {
|
||||
// versionString = fmt.Sprintf("%s-%s", versionString, main.VersionPrerelease)
|
||||
// }
|
||||
versionString := terraform.Version
|
||||
prerelease := terraform.VersionPrerelease
|
||||
if len(prerelease) > 0 {
|
||||
versionString = fmt.Sprintf("%s-%s", versionString, prerelease)
|
||||
}
|
||||
userAgent := fmt.Sprintf(
|
||||
"(%s %s) Terraform/%s", runtime.GOOS, runtime.GOARCH, versionString)
|
||||
|
||||
|
|
Loading…
Reference in New Issue