summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-01-30 10:41:10 +0100
committerGitHub <noreply@github.com>2019-01-30 10:41:10 +0100
commit76019c31f535c6473e5f7d645cf42ca4477e2c33 (patch)
treee2d595054ce380b5074bf0217e0c405ded94178a /pkg
parentad5579e1d9905996612dd135467ee2ee5f62b7d3 (diff)
parent656033ca969477ed809cbed57e752f959899d4f8 (diff)
downloadpodman-76019c31f535c6473e5f7d645cf42ca4477e2c33.tar.gz
podman-76019c31f535c6473e5f7d645cf42ca4477e2c33.tar.bz2
podman-76019c31f535c6473e5f7d645cf42ca4477e2c33.zip
Merge pull request #2205 from baude/prunelikedocker
podman image prune -- implement all flag
Diffstat (limited to 'pkg')
-rw-r--r--pkg/varlinkapi/images.go17
1 files changed, 4 insertions, 13 deletions
diff --git a/pkg/varlinkapi/images.go b/pkg/varlinkapi/images.go
index 744f031c0..d6a9b7301 100644
--- a/pkg/varlinkapi/images.go
+++ b/pkg/varlinkapi/images.go
@@ -627,19 +627,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)
}