Merge pull request #27545 from hashicorp/alisdair/remote-backend-version-check-state-migration

cli: Fix state migration remote version check
pull/27557/head
Alisdair McDiarmid 5 years ago committed by GitHub
commit a7d50d3264
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -70,6 +70,19 @@ func (m *Meta) backendMigrateState(opts *backendMigrateOpts) error {
opts.twoEnv = backend.DefaultStateName
opts.force = m.forceInitCopy
// Disregard remote Terraform version for the state source backend. If it's a
// Terraform Cloud remote backend, we don't care about the remote version,
// as we are migrating away and will not break a remote workspace.
m.ignoreRemoteBackendVersionConflict(opts.One)
// Check the remote Terraform version for the state destination backend. If
// it's a Terraform Cloud remote backend, we want to ensure that we don't
// break the workspace by uploading an incompatible state file.
diags := m.remoteBackendVersionCheck(opts.Two, opts.twoEnv)
if diags.HasErrors() {
return diags.Err()
}
// Determine migration behavior based on whether the source/destination
// supports multi-state.
switch {

Loading…
Cancel
Save