From ddac28255356e8d0737721cfcc1d00a0fb7c95e4 Mon Sep 17 00:00:00 2001 From: Alisdair McDiarmid Date: Wed, 13 Jan 2021 10:43:35 -0500 Subject: [PATCH] cli: Fix double check of remote workspace version After verifying the remote backend workspace version is compatible with the local Terraform version, we need to record that this check was successful. Otherwise the fallback error handling path will run a strict version check, even if the versions are compatible, which will cause an unexpected failure. --- command/meta_backend.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/command/meta_backend.go b/command/meta_backend.go index be7e37fdb..552e3aaa5 100644 --- a/command/meta_backend.go +++ b/command/meta_backend.go @@ -1115,6 +1115,11 @@ func (m *Meta) remoteBackendVersionCheck(b backend.Backend, workspace string) tf // an error versionDiags := rb.VerifyWorkspaceTerraformVersion(workspace) diags = diags.Append(versionDiags) + // If there are no errors resulting from this check, we do not need to + // check again + if !diags.HasErrors() { + rb.IgnoreVersionConflict() + } } return diags