summaryrefslogtreecommitdiff
path: root/cmd/podman/system/reset.go
diff options
context:
space:
mode:
authorAshley Cui <acui@redhat.com>2022-04-27 16:56:48 -0400
committerAshley Cui <acui@redhat.com>2022-05-04 10:31:42 -0400
commit80744c644135899a6dcc9fbe1b421dc08fc79802 (patch)
treea924d1cc59c0d99ca83f2d07800ae8655561977a /cmd/podman/system/reset.go
parent698cb730a1a7d36bc36e447969928ccb0a6317df (diff)
downloadpodman-80744c644135899a6dcc9fbe1b421dc08fc79802.tar.gz
podman-80744c644135899a6dcc9fbe1b421dc08fc79802.tar.bz2
podman-80744c644135899a6dcc9fbe1b421dc08fc79802.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.go')
-rw-r--r--cmd/podman/system/reset.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/cmd/podman/system/reset.go b/cmd/podman/system/reset.go
index 8f2e73375..176573bf6 100644
--- a/cmd/podman/system/reset.go
+++ b/cmd/podman/system/reset.go
@@ -61,7 +61,9 @@ func reset(cmd *cobra.Command, args []string) {
- all pods
- all images
- all networks
- - all build cache`)
+ - all build cache
+ - all machines`)
+
if len(listCtn) > 0 {
fmt.Println(`WARNING! The following external containers will be purged:`)
// print first 12 characters of ID and first configured name alias
@@ -103,5 +105,11 @@ func reset(cmd *cobra.Command, args []string) {
//nolint:gocritic
os.Exit(define.ExecErrorCodeGeneric)
}
+
+ // Shutdown podman-machine and delete all machine files
+ if err := resetMachine(); err != nil {
+ logrus.Error(err)
+ }
+
os.Exit(0)
}