diff options
author | Toshiki Sonoda <sonoda.toshiki@fujitsu.com> | 2022-06-22 13:12:46 +0900 |
---|---|---|
committer | Toshiki Sonoda <sonoda.toshiki@fujitsu.com> | 2022-06-22 13:12:46 +0900 |
commit | 0320ce37de642ec551bcb31806efcc75b07f1154 (patch) | |
tree | 529fbd532a16dbe1706f35911c787c032ea835f4 | |
parent | 15a651f860191a6cfe0b3d5f1c0a846e6a584091 (diff) | |
download | podman-0320ce37de642ec551bcb31806efcc75b07f1154.tar.gz podman-0320ce37de642ec551bcb31806efcc75b07f1154.tar.bz2 podman-0320ce37de642ec551bcb31806efcc75b07f1154.zip |
Fix system prune output message
'podman system prune' command always outputs "Deleted Images" message,
even though there is no dangling or unused image to remove.
This message should be output only if dangling or unused image exists.
[NO NEW TESTS NEEDED]
Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
-rw-r--r-- | cmd/podman/utils/utils.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/podman/utils/utils.go b/cmd/podman/utils/utils.go index 73bb34983..2ae123388 100644 --- a/cmd/podman/utils/utils.go +++ b/cmd/podman/utils/utils.go @@ -44,7 +44,7 @@ func PrintPodPruneResults(podPruneReports []*entities.PodPruneReport, heading bo func PrintContainerPruneResults(containerPruneReports []*reports.PruneReport, heading bool) error { var errs OutputErrors - if heading && (len(containerPruneReports) > 0) { + if heading && len(containerPruneReports) > 0 { fmt.Println("Deleted Containers") } for _, v := range containerPruneReports { @@ -72,7 +72,7 @@ func PrintVolumePruneResults(volumePruneReport []*reports.PruneReport, heading b } func PrintImagePruneResults(imagePruneReports []*reports.PruneReport, heading bool) error { - if heading { + if heading && len(imagePruneReports) > 0 { fmt.Println("Deleted Images") } for _, r := range imagePruneReports { |