diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-01-11 06:18:29 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-11 06:18:29 -0800 |
commit | 28c35cab8750f379a418e87ed6bd874a12ec158d (patch) | |
tree | d36fc6dc22b1461494e99268b2999344de7baafa /pkg | |
parent | 9368c24be6f289d21a0065df24471268ead59664 (diff) | |
parent | 7459c48863acea8453e0800124006a90ca82f646 (diff) | |
download | podman-28c35cab8750f379a418e87ed6bd874a12ec158d.tar.gz podman-28c35cab8750f379a418e87ed6bd874a12ec158d.tar.bz2 podman-28c35cab8750f379a418e87ed6bd874a12ec158d.zip |
Merge pull request #2135 from baude/varlinkprune
Add varlink support for prune
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/varlinkapi/images.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pkg/varlinkapi/images.go b/pkg/varlinkapi/images.go index 370fd091a..744f031c0 100644 --- a/pkg/varlinkapi/images.go +++ b/pkg/varlinkapi/images.go @@ -625,3 +625,21 @@ func (i *LibpodAPI) ContainerRunlabel(call iopodman.VarlinkCall, input iopodman. } return call.ReplyContainerRunlabel() } + +// ImagesPrune .... +func (i *LibpodAPI) ImagesPrune(call iopodman.VarlinkCall) error { + var ( + pruned []string + ) + pruneImages, err := i.Runtime.ImageRuntime().GetPruneImages() + 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.ReplyImagesPrune(pruned) +} |