Skip to content

Commit

Permalink
fix(qemu): Clean up state dir and log file when removing (#1325)
Browse files Browse the repository at this point in the history
Reviewed-by: Cezar Craciunoiu <[email protected]>
Approved-by: Cezar Craciunoiu <[email protected]>
  • Loading branch information
craciunoiuc authored Feb 28, 2024
2 parents fc799ff + 5c6915b commit b56aa9b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions machine/qemu/v1alpha1.go
Original file line number Diff line number Diff line change
Expand Up @@ -977,5 +977,8 @@ func (service *machineV1alpha1Service) Delete(ctx context.Context, machine *mach
_ = os.Remove(qcfg.QMP[0].Resource())
_ = os.Remove(qcfg.QMP[1].Resource())

errs = append(errs, os.RemoveAll(machine.Status.LogFile))
errs = append(errs, os.RemoveAll(machine.Status.StateDir))

return nil, errs.Err()
}

0 comments on commit b56aa9b

Please sign in to comment.