cli: Fix double check of remote workspace version #27498
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The result of this bug was that compatible remote and local Terraform versions (e.g 0.14.2 and 0.14.4) were prevented from working with commands like
taint
,import
,state mv
and so on, unless you use the-ignore-version-check
override. The same is true for incompatible remote and local versions (e.g. 0.13.5 and 0.14.4) for workspaces in "local" operations mode. This commit fixes both of those cases, which I've verified manually as this cannot be reasonably unit tested.Fixes #27480.