mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-03 06:44:50 -04:00
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:
parent
1f8eba37c8
commit
e66cb84d6e
16 changed files with 190 additions and 111 deletions
|
@ -41,7 +41,9 @@ type rollbackerTerraform struct {
|
|||
func (r *rollbackerTerraform) rollback(ctx context.Context) error {
|
||||
var err error
|
||||
err = multierr.Append(err, r.client.DestroyCluster(ctx))
|
||||
err = multierr.Append(err, r.client.CleanUpWorkspace())
|
||||
if err == nil {
|
||||
err = multierr.Append(err, r.client.CleanUpWorkspace())
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -54,6 +56,8 @@ func (r *rollbackerQEMU) rollback(ctx context.Context) error {
|
|||
var err error
|
||||
err = multierr.Append(err, r.client.DestroyCluster(ctx))
|
||||
err = multierr.Append(err, r.libvirt.Stop(ctx))
|
||||
err = multierr.Append(err, r.client.CleanUpWorkspace())
|
||||
if err == nil {
|
||||
err = r.client.CleanUpWorkspace()
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue