summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-01-14 14:48:50 -0600
committerbaude <bbaude@redhat.com>2019-01-14 15:40:33 -0600
commit1ffb0fc2d1d0e1acb43791591ebf2225a460df6d (patch)
tree8b6fdac3a9e443cb9972797e821c33b6ecb7cdde /cmd
parent6301f6a0a9e3989ecdf59fd5395d06c44f8bac14 (diff)
downloadpodman-1ffb0fc2d1d0e1acb43791591ebf2225a460df6d.tar.gz
podman-1ffb0fc2d1d0e1acb43791591ebf2225a460df6d.tar.bz2
podman-1ffb0fc2d1d0e1acb43791591ebf2225a460df6d.zip
podman remote client -- add rmi
allow the podman remote client to delete images Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/rmi.go19
1 files changed, 9 insertions, 10 deletions
diff --git a/cmd/podman/rmi.go b/cmd/podman/rmi.go
index 5e8ac81a2..482e6fff4 100644
--- a/cmd/podman/rmi.go
+++ b/cmd/podman/rmi.go
@@ -2,10 +2,9 @@ package main
import (
"fmt"
+ "github.com/containers/libpod/libpod/adapter"
"os"
- "github.com/containers/libpod/cmd/podman/libpodruntime"
- "github.com/containers/libpod/libpod/image"
"github.com/containers/storage"
"github.com/pkg/errors"
"github.com/urfave/cli"
@@ -58,11 +57,11 @@ func rmiCmd(c *cli.Context) error {
return err
}
removeAll := c.Bool("all")
- runtime, err := libpodruntime.GetRuntime(c)
+ localRuntime, err := adapter.GetRuntime(c)
if err != nil {
return errors.Wrapf(err, "could not get runtime")
}
- defer runtime.Shutdown(false)
+ defer localRuntime.Runtime.Shutdown(false)
args := c.Args()
if len(args) == 0 && !removeAll {
@@ -74,9 +73,9 @@ func rmiCmd(c *cli.Context) error {
images := args[:]
- removeImage := func(img *image.Image) {
+ removeImage := func(img *adapter.ContainerImage) {
deleted = true
- msg, deleteErr = runtime.RemoveImage(ctx, img, c.Bool("force"))
+ msg, deleteErr = localRuntime.RemoveImage(ctx, img, c.Bool("force"))
if deleteErr != nil {
if errors.Cause(deleteErr) == 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())
@@ -91,8 +90,8 @@ func rmiCmd(c *cli.Context) error {
}
if removeAll {
- var imagesToDelete []*image.Image
- imagesToDelete, err = runtime.ImageRuntime().GetImages()
+ var imagesToDelete []*adapter.ContainerImage
+ imagesToDelete, err = localRuntime.GetImages()
if err != nil {
return errors.Wrapf(err, "unable to query local images")
}
@@ -112,7 +111,7 @@ func rmiCmd(c *cli.Context) error {
removeImage(i)
}
lastNumberofImages = len(imagesToDelete)
- imagesToDelete, err = runtime.ImageRuntime().GetImages()
+ imagesToDelete, err = localRuntime.GetImages()
if err != nil {
return err
}
@@ -130,7 +129,7 @@ func rmiCmd(c *cli.Context) error {
// See https://github.com/containers/libpod/issues/930 as
// an exemplary inconsistency issue.
for _, i := range images {
- newImage, err := runtime.ImageRuntime().NewFromLocal(i)
+ newImage, err := localRuntime.NewImageFromLocal(i)
if err != nil {
fmt.Fprintln(os.Stderr, err)
continue