diff options
author | baude <bbaude@redhat.com> | 2018-01-04 15:29:36 -0600 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-01-08 18:15:55 +0000 |
commit | 6847636c30bb3b70882000189946cb36cc5a246a (patch) | |
tree | 48a244f068b61fbb0f56ac80ed28a12e57cddb96 /cmd/podman/rmi.go | |
parent | f881a8d17c677192ea862bcfc25b829f3cfd7392 (diff) | |
download | podman-6847636c30bb3b70882000189946cb36cc5a246a.tar.gz podman-6847636c30bb3b70882000189946cb36cc5a246a.tar.bz2 podman-6847636c30bb3b70882000189946cb36cc5a246a.zip |
Remove by shortname
Removing by shortname was not working. Also pruned
container storage's remove func from rmi and moved it into
an image.Remove func, which consolidates our usage of cs.
Signed-off-by: baude <bbaude@redhat.com>
Closes: #188
Approved by: baude
Diffstat (limited to 'cmd/podman/rmi.go')
-rw-r--r-- | cmd/podman/rmi.go | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/cmd/podman/rmi.go b/cmd/podman/rmi.go index 98ecc1883..f5938ffb9 100644 --- a/cmd/podman/rmi.go +++ b/cmd/podman/rmi.go @@ -64,22 +64,15 @@ func rmiCmd(c *cli.Context) error { } for _, arg := range imagesToDelete { - image, err := runtime.GetImage(arg) + image := runtime.NewImage(arg) + iid, err := image.Remove(c.Bool("force")) if err != nil { if lastError != nil { fmt.Fprintln(os.Stderr, lastError) } - lastError = errors.Wrapf(err, "could not get image %q", arg) - continue - } - id, err := runtime.RemoveImage(image, c.Bool("force")) - if err != nil { - if lastError != nil { - fmt.Fprintln(os.Stderr, lastError) - } - lastError = errors.Wrapf(err, "failed to remove image") + lastError = err } else { - fmt.Println(id) + fmt.Println(iid) } } return lastError |