Skip to content

Commit

Permalink
Remove returns success even if the VM doesn't exist
Browse files Browse the repository at this point in the history
crc delete won't fail and correctly delete ~/.crc/machines/crc
directory now when the VM is absent.
  • Loading branch information
guillaumerose committed Sep 6, 2021
1 parent bd18c39 commit a4cda99
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/libvirt/libvirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,9 @@ func (d *Driver) Stop() error {

func (d *Driver) Remove() error {
log.Debugf("Removing VM %s", d.MachineName)
if err := d.validateVMRef(); err != nil {
return err
_ = d.validateVMRef()
if !d.vmLoaded {
return nil
}
// Note: If we switch to qcow disks instead of raw the user
// could take a snapshot. If you do, then Undefine
Expand Down

0 comments on commit a4cda99

Please sign in to comment.