Introduce Podman machine reset

Podman machine reset is a new command that will "reset" your podman
machine environment.  Reset is defined as:

* Stop and Remove all VMs
* Remove the following directories:
    - configuration dir i.e. ~/.config/containers/podman/machine/qemu
    - data dir i.e. ~/.local/.share/containers/podman/machine/qemu

When deleting, if errors are encountered, they will be batched and spit
out at the end.  Podman will try to proceed even in error in doing what
it was told.

Signed-off-by: Brent Baude <bbaude@redhat.com>
This commit is contained in:
Brent Baude
2024-02-14 15:52:58 -06:00
parent fbb4d5dca6
commit 10d748f584
7 changed files with 315 additions and 13 deletions

View File

@ -0,0 +1,25 @@
package e2e_test
type resetMachine struct {
/*
-f, --force Stop and do not prompt before reseting
*/
force bool
cmd []string
}
func (i *resetMachine) buildCmd(m *machineTestBuilder) []string {
cmd := []string{"machine", "reset"}
if i.force {
cmd = append(cmd, "--force")
}
i.cmd = cmd
return cmd
}
func (i *resetMachine) withForce() *resetMachine {
i.force = true
return i
}