summaryrefslogtreecommitdiff
path: root/cmd/podman/system_prune.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-04-17 08:55:59 -0700
committerGitHub <noreply@github.com>2019-04-17 08:55:59 -0700
commit799d4667c1c33ac025741e2082739999f5b4563a (patch)
tree9fe87a7fc5f470314f754b8452163c4f59fd1a2c /cmd/podman/system_prune.go
parentd0c5e216ca508d195b805d0e48b159cfbff868a9 (diff)
parent4319552cf89e72925a80c63f427e5ef0a6376046 (diff)
downloadpodman-799d4667c1c33ac025741e2082739999f5b4563a.tar.gz
podman-799d4667c1c33ac025741e2082739999f5b4563a.tar.bz2
podman-799d4667c1c33ac025741e2082739999f5b4563a.zip
Merge pull request #2936 from haircommander/pod-prune
Add podman pod prune
Diffstat (limited to 'cmd/podman/system_prune.go')
-rw-r--r--cmd/podman/system_prune.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/cmd/podman/system_prune.go b/cmd/podman/system_prune.go
index 436d54823..14cb96941 100644
--- a/cmd/podman/system_prune.go
+++ b/cmd/podman/system_prune.go
@@ -59,6 +59,7 @@ func pruneSystemCmd(c *cliconfig.SystemPruneValues) error {
fmt.Printf(`
WARNING! This will remove:
- all stopped containers%s
+ - all stopped pods
- all dangling images
- all build cache
Are you sure you want to continue? [y/N] `, volumeString)
@@ -77,9 +78,17 @@ Are you sure you want to continue? [y/N] `, volumeString)
}
defer runtime.Shutdown(false)
+ rmWorkers := shared.Parallelize("rm")
ctx := getContext()
fmt.Println("Deleted Containers")
- lasterr := pruneContainers(runtime, ctx, shared.Parallelize("rm"), false, false)
+ lasterr := pruneContainers(runtime, ctx, rmWorkers, false, false)
+ fmt.Println("Deleted Pods")
+ if err := prunePods(runtime, ctx, rmWorkers, true); err != nil {
+ if lasterr != nil {
+ logrus.Errorf("%q", lasterr)
+ }
+ lasterr = err
+ }
if c.Bool("volumes") {
fmt.Println("Deleted Volumes")
err := volumePrune(runtime, getContext())