From a59e2a1a114c039e1780aa2b08b9452dc569cdf4 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Fri, 4 Dec 2020 14:06:52 -0500 Subject: Repeat system pruning until there is nothing removed Signed-off-by: Daniel J Walsh --- cmd/podman/system/prune.go | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'cmd/podman/system') 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 } -- cgit v1.2.3-54-g00ecf