summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/rmi.go15
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