aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/system
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-12-04 14:06:52 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2020-12-09 06:17:28 -0500
commita59e2a1a114c039e1780aa2b08b9452dc569cdf4 (patch)
tree1e40d530bd96ef9e4609383788175852465c49b8 /cmd/podman/system
parentdd295f297b6dd51d22c64c75f4ef4f80f953bbde (diff)
downloadpodman-a59e2a1a114c039e1780aa2b08b9452dc569cdf4.tar.gz
podman-a59e2a1a114c039e1780aa2b08b9452dc569cdf4.tar.bz2
podman-a59e2a1a114c039e1780aa2b08b9452dc569cdf4.zip
Repeat system pruning until there is nothing removed
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/system')
-rw-r--r--cmd/podman/system/prune.go19
1 files changed, 9 insertions, 10 deletions
diff --git a/cmd/podman/system/prune.go b/cmd/podman/system/prune.go
index f2b9a3db5..f57689584 100644
--- a/cmd/podman/system/prune.go
+++ b/cmd/podman/system/prune.go
@@ -73,32 +73,31 @@ Are you sure you want to continue? [y/N] `, volumeString)
return nil
}
}
+
// TODO: support for filters in system prune
response, err := registry.ContainerEngine().SystemPrune(context.Background(), pruneOptions)
if err != nil {
return err
}
- // Print pod prune results
- fmt.Println("Deleted Pods")
- err = utils.PrintPodPruneResults(response.PodPruneReport)
+ // Print container prune results
+ err = utils.PrintContainerPruneResults(response.ContainerPruneReport, true)
if err != nil {
return err
}
- // Print container prune results
- fmt.Println("Deleted Containers")
- err = utils.PrintContainerPruneResults(response.ContainerPruneReport)
+ // Print pod prune results
+ err = utils.PrintPodPruneResults(response.PodPruneReport, true)
if err != nil {
return err
}
// Print Volume prune results
if pruneOptions.Volume {
- fmt.Println("Deleted Volumes")
- err = utils.PrintVolumePruneResults(response.VolumePruneReport)
+ err = utils.PrintVolumePruneResults(response.VolumePruneReport, true)
if err != nil {
return err
}
}
// Print Images prune results
- fmt.Println("Deleted Images")
- return utils.PrintImagePruneResults(response.ImagePruneReport)
+ utils.PrintImagePruneResults(response.ImagePruneReport, true)
+
+ return nil
}