• Alisdair McDiarmid's avatar
    cli: Fix state migration remote version check · 212a97c3
    Alisdair McDiarmid authored
    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.
    212a97c3