summaryrefslogtreecommitdiff
path: root/pkg/adapter/runtime_remote.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-12-23 09:33:29 -0600
committerbaude <bbaude@redhat.com>2019-12-23 10:02:14 -0600
commit4f09cfdaccfdd0f1deb01e52c7e1b18a9cec7d49 (patch)
tree491fcc6d89f0cabb26fdf2578e830b332205d589 /pkg/adapter/runtime_remote.go
parentfcd48db4d24f6dba4fb2652d72aa0d86e167aa0c (diff)
downloadpodman-4f09cfdaccfdd0f1deb01e52c7e1b18a9cec7d49.tar.gz
podman-4f09cfdaccfdd0f1deb01e52c7e1b18a9cec7d49.tar.bz2
podman-4f09cfdaccfdd0f1deb01e52c7e1b18a9cec7d49.zip
add struct response for removal of images
when removing an image from storage, we should return a struct that details what was untagged vs deleted. this replaces the simple println's used previously and assists in API development. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/adapter/runtime_remote.go')
-rw-r--r--pkg/adapter/runtime_remote.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/pkg/adapter/runtime_remote.go b/pkg/adapter/runtime_remote.go
index 87b4999ce..fe5cc4fef 100644
--- a/pkg/adapter/runtime_remote.go
+++ b/pkg/adapter/runtime_remote.go
@@ -414,8 +414,15 @@ func (ci *ContainerImage) TagImage(tag string) error {
}
// RemoveImage calls varlink to remove an image
-func (r *LocalRuntime) RemoveImage(ctx context.Context, img *ContainerImage, force bool) (string, error) {
- return iopodman.RemoveImage().Call(r.Conn, img.InputName, force)
+func (r *LocalRuntime) RemoveImage(ctx context.Context, img *ContainerImage, force bool) (*image.ImageDeleteResponse, error) {
+ ir := image.ImageDeleteResponse{}
+ response, err := iopodman.RemoveImageWithResponse().Call(r.Conn, img.InputName, force)
+ if err != nil {
+ return nil, err
+ }
+ ir.Deleted = response.Deleted
+ ir.Untagged = append(ir.Untagged, response.Untagged...)
+ return &ir, nil
}
// History returns the history of an image and its layers