diff options
author | baude <bbaude@redhat.com> | 2019-01-22 09:17:34 -0600 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-02-08 15:02:28 -0500 |
commit | 431459caf946c1645da31b4fc6c953ad77f9bc85 (patch) | |
tree | 77ecef4eff5b8e4252a4bbc5f70a56bfa4882958 /pkg | |
parent | 28f5d25e8dabb6647699c2ccab8621cefac37d3b (diff) | |
download | podman-431459caf946c1645da31b4fc6c953ad77f9bc85.tar.gz podman-431459caf946c1645da31b4fc6c953ad77f9bc85.tar.bz2 podman-431459caf946c1645da31b4fc6c953ad77f9bc85.zip |
podman image prune -- implement all flag
we now, by default, only prune dangling images. if --all is passed, we
prune dangling images AND images that do not have an associated containers.
also went ahead and enabled the podman-remote image prune side of things.
Fixes: #2192
Signed-off-by: baude <bbaude@redhat.com>
MH: Removed dependence on remote-client adapter work to limit scale of changes
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/varlinkapi/images.go | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/pkg/varlinkapi/images.go b/pkg/varlinkapi/images.go index 4a4f20031..cfcdde6ef 100644 --- a/pkg/varlinkapi/images.go +++ b/pkg/varlinkapi/images.go @@ -622,19 +622,10 @@ func (i *LibpodAPI) ContainerRunlabel(call iopodman.VarlinkCall, input iopodman. } // ImagesPrune .... -func (i *LibpodAPI) ImagesPrune(call iopodman.VarlinkCall) error { - var ( - pruned []string - ) - pruneImages, err := i.Runtime.ImageRuntime().GetPruneImages() +func (i *LibpodAPI) ImagesPrune(call iopodman.VarlinkCall, all bool) error { + prunedImages, err := i.Runtime.ImageRuntime().PruneImages(all) if err != nil { - return err - } - for _, i := range pruneImages { - if err := i.Remove(true); err != nil { - return call.ReplyErrorOccurred(err.Error()) - } - pruned = append(pruned, i.ID()) + return call.ReplyErrorOccurred(err.Error()) } - return call.ReplyImagesPrune(pruned) + return call.ReplyImagesPrune(prunedImages) } |