Fix terraform version in cloud e2e tests to ignore prerelease. (#29)

This commit is contained in:
Omar Ismail 2021-10-04 09:57:46 -04:00 committed by Chris Arcand
parent a387af6c61
commit d5567b479c
1 changed files with 5 additions and 3 deletions

View File

@ -59,10 +59,10 @@ func setTfeClient() {
hostname := os.Getenv("TFE_HOSTNAME") hostname := os.Getenv("TFE_HOSTNAME")
token := os.Getenv("TFE_TOKEN") token := os.Getenv("TFE_TOKEN")
if hostname == "" { if hostname == "" {
log.Fatalf("hostname cannot be empty") log.Fatal("hostname cannot be empty")
} }
if token == "" { if token == "" {
log.Fatalf("token cannot be empty") log.Fatal("token cannot be empty")
} }
tfeHostname = hostname tfeHostname = hostname
tfeToken = token tfeToken = token
@ -138,7 +138,9 @@ func setVersion() {
hash := string(out)[0:8] hash := string(out)[0:8]
terraformVersion = fmt.Sprintf("%s-%s", data["terraform_version"].(string), hash) fullVersion := data["terraform_version"].(string)
version := strings.Split(fullVersion, "-")[0]
terraformVersion = fmt.Sprintf("%s-%s", version, hash)
} }
func ensureVersionExists() { func ensureVersionExists() {