diff options
author | Sujil02 <sushah@redhat.com> | 2020-04-29 22:41:56 -0400 |
---|---|---|
committer | Sujil02 <sushah@redhat.com> | 2020-05-01 13:57:16 -0400 |
commit | b94862171b29dbef4cd780e4b1746d97f62f7a94 (patch) | |
tree | 6d64486633a4ebc208f31431c81f1932ade979f4 /cmd/podman/pods/prune.go | |
parent | 2f3762eb911258016581187f072a24ac2724be3b (diff) | |
download | podman-b94862171b29dbef4cd780e4b1746d97f62f7a94.tar.gz podman-b94862171b29dbef4cd780e4b1746d97f62f7a94.tar.bz2 podman-b94862171b29dbef4cd780e4b1746d97f62f7a94.zip |
And system prune feature for v2.
Adds podman system prune for v2.
Refactoring for code reuse from pods containers images and volume prune.
Adds and enables testcases to support the added feature.
Signed-off-by: Sujil02 <sushah@redhat.com>
Diffstat (limited to 'cmd/podman/pods/prune.go')
-rw-r--r-- | cmd/podman/pods/prune.go | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/cmd/podman/pods/prune.go b/cmd/podman/pods/prune.go index 091e3375b..bc15d8035 100644 --- a/cmd/podman/pods/prune.go +++ b/cmd/podman/pods/prune.go @@ -41,9 +41,6 @@ func init() { } func prune(cmd *cobra.Command, args []string) error { - var ( - errs utils.OutputErrors - ) if len(args) > 0 { return errors.Errorf("`%s` takes no arguments", cmd.CommandPath()) } @@ -60,16 +57,8 @@ func prune(cmd *cobra.Command, args []string) error { } } responses, err := registry.ContainerEngine().PodPrune(context.Background(), pruneOptions) - if err != nil { return err } - for _, r := range responses { - if r.Err == nil { - fmt.Println(r.Id) - } else { - errs = append(errs, r.Err) - } - } - return errs.PrintErrors() + return utils.PrintPodPruneResults(responses) } |