Skip to content

Commit

Permalink
cli: Fix double check of remote workspace version
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alisdair committed Jan 13, 2021
1 parent dcf49dc commit ddac282
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions command/meta_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ddac282

Please sign in to comment.