mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-04 07:15:05 -04:00
cli: remove unnecessary check from QEMU rollbacker (#2489)
Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
9c89b75a53
commit
d154703c9a
3 changed files with 17 additions and 29 deletions
|
@ -50,19 +50,17 @@ func (r *rollbackerTerraform) rollback(ctx context.Context, w io.Writer, logLeve
|
|||
}
|
||||
|
||||
type rollbackerQEMU struct {
|
||||
client tfResourceClient
|
||||
libvirt libvirtRunner
|
||||
createdWorkspace bool
|
||||
client tfResourceClient
|
||||
libvirt libvirtRunner
|
||||
}
|
||||
|
||||
func (r *rollbackerQEMU) rollback(ctx context.Context, w io.Writer, logLevel terraform.LogLevel) (retErr error) {
|
||||
if r.createdWorkspace {
|
||||
retErr = r.client.Destroy(ctx, logLevel)
|
||||
}
|
||||
if retErr := errors.Join(retErr, r.libvirt.Stop(ctx)); retErr != nil {
|
||||
func (r *rollbackerQEMU) rollback(ctx context.Context, w io.Writer, logLevel terraform.LogLevel) error {
|
||||
tfErr := r.client.Destroy(ctx, logLevel)
|
||||
libvirtErr := r.libvirt.Stop(ctx)
|
||||
if err := errors.Join(tfErr, libvirtErr); err != nil {
|
||||
fmt.Fprintf(w, "Could not destroy the resources. Please delete the %q directory manually if no resources were created\n",
|
||||
constants.TerraformWorkingDir)
|
||||
return retErr
|
||||
return err
|
||||
}
|
||||
return r.client.CleanUpWorkspace()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue