summaryrefslogtreecommitdiff
path: root/cmd/podman/utils
diff options
context:
space:
mode:
authorToshiki Sonoda <sonoda.toshiki@fujitsu.com>2022-07-08 08:33:20 +0900
committerToshiki Sonoda <sonoda.toshiki@fujitsu.com>2022-07-08 08:33:20 +0900
commitd1754bdd4f299c8d92671493add4a69ef7850e1d (patch)
treec4fd3d741d641d16267aa8431c430cc095ac250e /cmd/podman/utils
parent700f1faf6e5449e13970fc17311b09e4ca9ac2c3 (diff)
downloadpodman-d1754bdd4f299c8d92671493add4a69ef7850e1d.tar.gz
podman-d1754bdd4f299c8d92671493add4a69ef7850e1d.tar.bz2
podman-d1754bdd4f299c8d92671493add4a69ef7850e1d.zip
Refactored networkPrune function
Refactored the networkPrune function to improve readability. This commit changes the `networkPrune` function to use the `PrintNetworkPruneResults` function. [NO NEW TESTS NEEDED] Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
Diffstat (limited to 'cmd/podman/utils')
-rw-r--r--cmd/podman/utils/utils.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/podman/utils/utils.go b/cmd/podman/utils/utils.go
index 2ae123388..a265faf51 100644
--- a/cmd/podman/utils/utils.go
+++ b/cmd/podman/utils/utils.go
@@ -85,16 +85,16 @@ func PrintImagePruneResults(imagePruneReports []*reports.PruneReport, heading bo
return nil
}
-func PrintNetworkPruneResults(networkPruneReport []*reports.PruneReport, heading bool) error {
+func PrintNetworkPruneResults(networkPruneReport []*entities.NetworkPruneReport, heading bool) error {
var errs OutputErrors
if heading && len(networkPruneReport) > 0 {
fmt.Println("Deleted Networks")
}
for _, r := range networkPruneReport {
- if r.Err == nil {
- fmt.Println(r.Id)
+ if r.Error == nil {
+ fmt.Println(r.Name)
} else {
- errs = append(errs, r.Err)
+ errs = append(errs, r.Error)
}
}
return errs.PrintErrors()