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

Backport of cli: Fix state migration remote version check into v0.14 #27556

Conversation

teamterraform
Copy link
Contributor

Backport

This PR is auto-generated from #27545 to be assessed for backporting due to the inclusion of the label 0.14-backport.

The below text is copied from the body of the original PR.


Previously the state migration process was using the fallback strict error check when migrating to or from a Terraform Cloud workspace. This resulted in an error when running init if the local and remote Terraform versions did not exactly match.

This was excessively strict. When migrating from a remote Terraform Cloud workspace to local state, there is no need for a version check at all, as we cannot break the Terraform Cloud workspace. When migrating to Terraform Cloud, we should use the more forgiving check, rather than the strict equality.

This commit fixes both of these cases accordingly, and allows migrating state to and from Terraform Cloud remote workspaces without errors.

Fixes #27543

@teamterraform teamterraform force-pushed the backport/alisdair/remote-backend-version-check-state-migration/hopelessly-capable-stud branch from 36f4433 to d87eebb Compare January 20, 2021 16:08
@codecov
Copy link

codecov bot commented Jan 20, 2021

Codecov Report

Merging #27556 (ce0fd32) into v0.14 (bb129d8) will increase coverage by 0.00%.
The diff coverage is 50.00%.

Impacted Files Coverage Δ
command/meta_backend_migrate.go 56.88% <50.00%> (-0.13%) ⬇️
dag/marshal.go 53.42% <0.00%> (-1.37%) ⬇️
dag/walk.go 92.30% <0.00%> (+0.69%) ⬆️
terraform/node_resource_plan.go 97.19% <0.00%> (+1.86%) ⬆️
internal/providercache/dir.go 73.46% <0.00%> (+6.12%) ⬆️

@alisdair alisdair merged commit 58dffe1 into v0.14 Jan 20, 2021
@alisdair alisdair deleted the backport/alisdair/remote-backend-version-check-state-migration/hopelessly-capable-stud branch January 20, 2021 16:19
@ghost
Copy link

ghost commented Feb 20, 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 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants