Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: Fix double check of remote workspace version #27498

Merged
merged 1 commit into from
Jan 14, 2021

Conversation

alisdair
Copy link
Contributor

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.

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.
@alisdair alisdair added cli 0.14-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged labels Jan 13, 2021
@alisdair alisdair requested a review from a team January 13, 2021 15:49
@alisdair alisdair self-assigned this Jan 13, 2021
@codecov
Copy link

codecov bot commented Jan 13, 2021

Codecov Report

Merging #27498 (ddac282) into master (dcf49dc) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted Files Coverage Δ
command/meta_backend.go 56.61% <0.00%> (-0.21%) ⬇️
states/statefile/version4.go 57.96% <0.00%> (-0.24%) ⬇️

Copy link
Contributor

@pselle pselle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for hunting down the tricky cases!

@ghost
Copy link

ghost commented Feb 14, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Feb 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
0.14-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged cli
Projects
None yet
Development

Successfully merging this pull request may close these issues.

backend/remote: Unable to taint remote resources in local execution mode
2 participants