diff --git a/internal/cli/command/controlplane/exec.go b/internal/cli/command/controlplane/exec.go index 5f8bcb47..d610990f 100644 --- a/internal/cli/command/controlplane/exec.go +++ b/internal/cli/command/controlplane/exec.go @@ -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") } @@ -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") } diff --git a/internal/cli/command/controlplane/installer_options.go b/internal/cli/command/controlplane/installer_options.go index d1d9de65..c9aa4ac4 100644 --- a/internal/cli/command/controlplane/installer_options.go +++ b/internal/cli/command/controlplane/installer_options.go @@ -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) {