summaryrefslogtreecommitdiff
path: root/pkg/adapter
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2019-11-22 11:39:49 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2019-11-29 05:34:52 -0500
commit79bf5010eda37c07f577414ae71ecb8f8c8714a2 (patch)
treecd2d631a0c42d7bbb4f1b2631be8d833071644da /pkg/adapter
parentb4313b296a271097d26e481a0f03d22b9bab683b (diff)
downloadpodman-79bf5010eda37c07f577414ae71ecb8f8c8714a2.tar.gz
podman-79bf5010eda37c07f577414ae71ecb8f8c8714a2.tar.bz2
podman-79bf5010eda37c07f577414ae71ecb8f8c8714a2.zip
Add podman system reset command
This command will destroy all data created via podman. It will remove containers, images, volumes, pods. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/adapter')
-rw-r--r--pkg/adapter/reset.go13
-rw-r--r--pkg/adapter/reset_remote.go12
2 files changed, 25 insertions, 0 deletions
diff --git a/pkg/adapter/reset.go b/pkg/adapter/reset.go
new file mode 100644
index 000000000..0decc3d15
--- /dev/null
+++ b/pkg/adapter/reset.go
@@ -0,0 +1,13 @@
+// +build !remoteclient
+
+package adapter
+
+import (
+ "context"
+)
+
+// Reset the container storage back to initial states.
+// Removes all Pods, Containers, Images and Volumes.
+func (r *LocalRuntime) Reset() error {
+ return r.Runtime.Reset(context.TODO())
+}
diff --git a/pkg/adapter/reset_remote.go b/pkg/adapter/reset_remote.go
new file mode 100644
index 000000000..663fab639
--- /dev/null
+++ b/pkg/adapter/reset_remote.go
@@ -0,0 +1,12 @@
+// +build remoteclient
+
+package adapter
+
+import (
+ "github.com/containers/libpod/cmd/podman/varlink"
+)
+
+// Info returns information for the host system and its components
+func (r RemoteRuntime) Reset() error {
+ return iopodman.Reset().Call(r.Conn)
+}