AB#2532 Dont clean up workspace if rollback fails (#360)

* Dont clean up workspace if rollback fails

* Remove dependency on CSP from terminate

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2022-10-26 15:57:00 +02:00 committed by GitHub
parent 1f8eba37c8
commit e66cb84d6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 190 additions and 111 deletions

View file

@ -16,7 +16,6 @@ import (
"go.uber.org/multierr"
"github.com/edgelesssys/constellation/v2/cli/internal/cloudcmd"
"github.com/edgelesssys/constellation/v2/cli/internal/clusterid"
"github.com/edgelesssys/constellation/v2/internal/constants"
"github.com/edgelesssys/constellation/v2/internal/file"
)
@ -45,13 +44,8 @@ func runTerminate(cmd *cobra.Command, args []string) error {
func terminate(cmd *cobra.Command, terminator cloudTerminator, fileHandler file.Handler, spinner spinnerInterf,
) error {
var idFile clusterid.File
if err := fileHandler.ReadJSON(constants.ClusterIDsFileName, &idFile); err != nil {
return err
}
spinner.Start("Terminating", false)
err := terminator.Terminate(cmd.Context(), idFile.CloudProvider)
err := terminator.Terminate(cmd.Context())
spinner.Stop()
if err != nil {
return fmt.Errorf("terminating Constellation cluster: %w", err)