Skip to content

Commit

Permalink
use ignoreLegacyStateInitErr in OverrideBackendToLocal
Browse files Browse the repository at this point in the history
Per feedback from @minamijoyo...

> Because the supportStateReplaceProvider depends on the Terraform
version; on the other hand, the ignoreLegacyStateInitErr depends on
actions. The ignoreLegacyStateInitErr is more strict to check.

#145 (comment)
  • Loading branch information
mdb committed Sep 4, 2023
1 parent 67ed675 commit 7408063
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tfmigrate/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func setupWorkDir(ctx context.Context, tf tfexec.TerraformCLI, workspace string,
}
// override backend to local
log.Printf("[INFO] [migrator@%s] override backend to local\n", tf.Dir())
switchBackToRemoteFunc, err := tf.OverrideBackendToLocal(ctx, "_tfmigrate_override.tf", workspace, isBackendTerraformCloud, backendConfig, supportsStateReplaceProvider)
switchBackToRemoteFunc, err := tf.OverrideBackendToLocal(ctx, "_tfmigrate_override.tf", workspace, isBackendTerraformCloud, backendConfig, ignoreLegacyStateInitErr)
if err != nil {
return nil, nil, err
}
Expand Down

0 comments on commit 7408063

Please sign in to comment.