summaryrefslogtreecommitdiff
path: root/cmd/podman/system/reset_machine.go
diff options
context:
space:
mode:
authorAshley Cui <acui@redhat.com>2022-04-27 16:56:48 -0400
committeropenshift-cherrypick-robot <>2022-05-04 18:06:23 +0000
commitd3f406e9f6fe3c33228d0f384f986982640d2f43 (patch)
treea1eee345deaeeca0efedbde48a8ce4d6fe32af16 /cmd/podman/system/reset_machine.go
parentc4357f0f7b7a032908abfab358616d82163eaf9e (diff)
downloadpodman-d3f406e9f6fe3c33228d0f384f986982640d2f43.tar.gz
podman-d3f406e9f6fe3c33228d0f384f986982640d2f43.tar.bz2
podman-d3f406e9f6fe3c33228d0f384f986982640d2f43.zip
podman system reset removed machines incorrectly
podman system reset did not clean up machines fully, leaving some config files, and breaking machines. Now it removes all machines files fully. Signed-off-by: Ashley Cui <acui@redhat.com>
Diffstat (limited to 'cmd/podman/system/reset_machine.go')
-rw-r--r--cmd/podman/system/reset_machine.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/cmd/podman/system/reset_machine.go b/cmd/podman/system/reset_machine.go
new file mode 100644
index 000000000..a07b4fb83
--- /dev/null
+++ b/cmd/podman/system/reset_machine.go
@@ -0,0 +1,13 @@
+//go:build (amd64 && !remote) || (arm64 && !remote)
+// +build amd64,!remote arm64,!remote
+
+package system
+
+import (
+ cmdMach "github.com/containers/podman/v4/cmd/podman/machine"
+)
+
+func resetMachine() error {
+ provider := cmdMach.GetSystemDefaultProvider()
+ return provider.RemoveAndCleanMachines()
+}