Skip to content

Commit

Permalink
Revert "up: mount original tfstate for migrate (#224)" (#225)
Browse files Browse the repository at this point in the history
This reverts commit f501798.
  • Loading branch information
bonifaido authored Mar 31, 2020
1 parent 8c03ebd commit 9a4c8ac
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
6 changes: 0 additions & 6 deletions internal/cli/command/controlplane/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,6 @@ func runTerraformCommandGeneric(options *cpContext, cmd []string, cmdEnv map[str
"-v", fmt.Sprintf("%s:/terraform/state.tf.json", options.workspace+"/state.tf.json"),
"-v", fmt.Sprintf("%s:/terraform/.terraform/terraform.tfstate", options.workspace+"/.terraform/terraform.tfstate"),
}
if options.tfstateExists() {
args = append(args, "-v", fmt.Sprintf("%s:/terraform/terraform.tfstate", options.tfstatePath()))
}
if options.banzaiCli.Interactive() {
args = append(args, "-ti")
}
Expand All @@ -278,9 +275,6 @@ func runTerraformCommandGeneric(options *cpContext, cmd []string, cmdEnv map[str
"--mount", fmt.Sprintf("type=bind,src=%s,dst=/terraform/state.tf.json,options=rbind:rw", options.workspace+"/state.tf.json"),
"--mount", fmt.Sprintf("type=bind,src=%s,dst=/terraform/.terraform/terraform.tfstate,options=rbind:rw", options.workspace+"/.terraform/terraform.tfstate"),
}
if options.tfstateExists() {
args = append(args, "--mount", fmt.Sprintf("type=bind,src=%s,dst=/terraform/terraform.tfstate,options=rbind:rw", options.tfstatePath()))
}
if options.banzaiCli.Interactive() {
args = append(args, "-t")
}
Expand Down
5 changes: 0 additions & 5 deletions internal/cli/command/controlplane/installer_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,6 @@ func (c *cpContext) tfstatePath() string {
return filepath.Join(c.workspace, tfstateFilename)
}

func (c *cpContext) tfstateExists() bool {
_, err := os.Stat(c.tfstatePath())
return err == nil
}

func (c *cpContext) deleteTfstate() error {
_, err := os.Stat(c.tfstatePath())
if os.IsNotExist(err) {
Expand Down

0 comments on commit 9a4c8ac

Please sign in to comment.