diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-12-23 18:01:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-23 18:01:32 +0100 |
commit | d62fce0c873bdd1341af15eba4418ff83af7edba (patch) | |
tree | 9c4f9b09f18ffb47ecc50b6b5058e64c390ec57d /cmd/podman/rmi.go | |
parent | d43bff7cc6484927487ded4246e7625c8b42b5e8 (diff) | |
parent | 4f09cfdaccfdd0f1deb01e52c7e1b18a9cec7d49 (diff) | |
download | podman-d62fce0c873bdd1341af15eba4418ff83af7edba.tar.gz podman-d62fce0c873bdd1341af15eba4418ff83af7edba.tar.bz2 podman-d62fce0c873bdd1341af15eba4418ff83af7edba.zip |
Merge pull request #4743 from baude/imageresponse
add struct response for removal of images
Diffstat (limited to 'cmd/podman/rmi.go')
-rw-r--r-- | cmd/podman/rmi.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/cmd/podman/rmi.go b/cmd/podman/rmi.go index 3f621116e..f4ca88ea8 100644 --- a/cmd/podman/rmi.go +++ b/cmd/podman/rmi.go @@ -68,7 +68,7 @@ func rmiCmd(c *cliconfig.RmiValues) error { images := args[:] removeImage := func(img *adapter.ContainerImage) { - msg, err := runtime.RemoveImage(ctx, img, c.Force) + response, err := runtime.RemoveImage(ctx, img, c.Force) if err != nil { if errors.Cause(err) == storage.ErrImageUsedByContainer { fmt.Printf("A container associated with containers/storage, i.e. via Buildah, CRI-O, etc., may be associated with this image: %-12.12s\n", img.ID()) @@ -83,7 +83,14 @@ func rmiCmd(c *cliconfig.RmiValues) error { lastError = err return } - fmt.Println(msg) + // Iterate if any images tags were deleted + for _, i := range response.Untagged { + fmt.Printf("Untagged: %s\n", i) + } + // Make sure an image was deleted (and not just untagged); else print it + if len(response.Deleted) > 0 { + fmt.Printf("Deleted: %s\n", response.Deleted) + } } if removeAll { |