summaryrefslogtreecommitdiff
path: root/libpod/runtime_img.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-08-05 09:57:43 -0500
committerbaude <bbaude@redhat.com>2019-08-08 20:05:55 -0500
commite27ee5c840ac1ea10f3055287cc8256cddeeb083 (patch)
treecc8eb417c672463a2bdfb394dec08a34e8737418 /libpod/runtime_img.go
parent4349f42d66d91fa48cde6aa6ed499eaa41d3e2b5 (diff)
downloadpodman-e27ee5c840ac1ea10f3055287cc8256cddeeb083.tar.gz
podman-e27ee5c840ac1ea10f3055287cc8256cddeeb083.tar.bz2
podman-e27ee5c840ac1ea10f3055287cc8256cddeeb083.zip
make rmi messages more compatible with docker
in the case where we rmi an image that has only one reponame, we print out an untagged reponame message. $ sudo podman rmi busybox Untagged: docker.io/library/busybox:latest Deleted: db8ee88ad75f6bdc74663f4992a185e2722fa29573abcc1a19186cc5ec09dceb Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'libpod/runtime_img.go')
-rw-r--r--libpod/runtime_img.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/libpod/runtime_img.go b/libpod/runtime_img.go
index 4055734eb..20dee4080 100644
--- a/libpod/runtime_img.go
+++ b/libpod/runtime_img.go
@@ -28,6 +28,7 @@ import (
// RemoveImage deletes an image from local storage
// Images being used by running containers can only be removed if force=true
func (r *Runtime) RemoveImage(ctx context.Context, img *image.Image, force bool) (string, error) {
+ var returnMessage string
r.lock.Lock()
defer r.lock.Unlock()
@@ -93,7 +94,11 @@ func (r *Runtime) RemoveImage(ctx context.Context, img *image.Image, force bool)
err = errStorage
}
}
- return img.ID(), err
+ for _, name := range img.Names() {
+ returnMessage = returnMessage + fmt.Sprintf("Untagged: %s\n", name)
+ }
+ returnMessage = returnMessage + fmt.Sprintf("Deleted: %s", img.ID())
+ return returnMessage, err
}
// Remove containers that are in storage rather than Podman.