From 12a4af3e72416b59f2a0c4b5afb52ddc668d23e4 Mon Sep 17 00:00:00 2001 From: Chris Arcand Date: Thu, 21 Oct 2021 22:25:00 -0500 Subject: [PATCH] Temporarily skip API version checking --- internal/cloud/backend.go | 18 ++++++++++-------- internal/cloud/backend_test.go | 1 + internal/cloud/versioning.go | 6 +++--- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/internal/cloud/backend.go b/internal/cloud/backend.go index 08dafb275..e6b0ba98a 100644 --- a/internal/cloud/backend.go +++ b/internal/cloud/backend.go @@ -295,14 +295,16 @@ func (b *Cloud) Configure(obj cty.Value) tfdiags.Diagnostics { desiredAPIVersion, _ := version.NewVersion("2.5") if parseErr != nil || currentAPIVersion.LessThan(desiredAPIVersion) { - diags = diags.Append(tfdiags.Sourceless( - tfdiags.Error, - "Unsupported Terraform Enterprise version", - fmt.Sprintf( - `The 'cloud' option requires Terraform Enterprise %s or later.`, - apiToMinimumTFEVersion["2.5"], - ), - )) + log.Printf("[TRACE] API version check failed; want: >= %s, got: %s", desiredAPIVersion.Original(), currentAPIVersion) + // FIXME: Skip version checking temporarily. + // diags = diags.Append(tfdiags.Sourceless( + // tfdiags.Error, + // "Unsupported Terraform Enterprise version", + // fmt.Sprintf( + // `The 'cloud' option requires Terraform Enterprise %s or later.`, + // apiToMinimumTFEVersion["2.5"], + // ), + // )) } // Configure a local backend for when we need to run operations locally. diff --git a/internal/cloud/backend_test.go b/internal/cloud/backend_test.go index cd2995887..d3b5d7c5f 100644 --- a/internal/cloud/backend_test.go +++ b/internal/cloud/backend_test.go @@ -269,6 +269,7 @@ func TestCloud_config(t *testing.T) { } func TestCloud_configVerifyMinimumTFEVersion(t *testing.T) { + t.Skip("skipping, as TFE version checking has been temporarily disabled") config := cty.ObjectVal(map[string]cty.Value{ "hostname": cty.NullVal(cty.String), "organization": cty.StringVal("hashicorp"), diff --git a/internal/cloud/versioning.go b/internal/cloud/versioning.go index b07fd74aa..4b9ee52e1 100644 --- a/internal/cloud/versioning.go +++ b/internal/cloud/versioning.go @@ -7,6 +7,6 @@ package cloud // The cloud package here, introduced in Terraform 1.1.0, requires a minimum of 2.5 (v202201-1) // The TFP-API-Version header that this refers to was introduced in 2.3 (v202006-1), so an absent // header can be considered < 2.3. -var apiToMinimumTFEVersion = map[string]string{ - "2.5": "v202201-1", -} +// var apiToMinimumTFEVersion = map[string]string{ +// "2.5": "v202201-1", +// }