Minor things

This commit is contained in:
AlexSSD7 2023-08-30 15:24:25 +01:00
commit 41d8cb42c9
5 changed files with 47 additions and 12 deletions

View file

@ -93,7 +93,19 @@ func (s *Storage) BuildVMImageWithInterruptHandler(showBuilderVMDisplay bool, ov
return errors.Wrap(err, "create new img build context")
}
return errors.Wrap(buildCtx.BuildWithInterruptHandler(), "build")
err = buildCtx.BuildWithInterruptHandler()
if err != nil {
return errors.Wrap(err, "do build")
}
err = os.Remove(baseImagePath)
if err != nil {
s.logger.Error("Failed to remove base image", "error", err.Error(), "path", baseImagePath)
} else {
s.logger.Info("Removed base image", "path", baseImagePath)
}
return nil
}
func (s *Storage) CheckVMImageExists() (string, error) {