diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-02-14 22:52:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-14 22:52:03 +0100 |
commit | ae8cc41295c4ff6f6f82372221c66c250691e4f6 (patch) | |
tree | 197c210011a5c40a9beccafea8a22c52314f28de /pkg/varlinkapi | |
parent | 1a9128d1e4851df7c0316e0b861e70605fd262f6 (diff) | |
parent | 5be818e715d57f98e4a930632bc599e3fee3aaed (diff) | |
download | podman-ae8cc41295c4ff6f6f82372221c66c250691e4f6.tar.gz podman-ae8cc41295c4ff6f6f82372221c66c250691e4f6.tar.bz2 podman-ae8cc41295c4ff6f6f82372221c66c250691e4f6.zip |
Merge pull request #2332 from baude/remotevolumeprune
volume prune
Diffstat (limited to 'pkg/varlinkapi')
-rw-r--r-- | pkg/varlinkapi/volumes.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pkg/varlinkapi/volumes.go b/pkg/varlinkapi/volumes.go index d41b07065..02874d2b1 100644 --- a/pkg/varlinkapi/volumes.go +++ b/pkg/varlinkapi/volumes.go @@ -72,3 +72,19 @@ func (i *LibpodAPI) GetVolumes(call iopodman.VarlinkCall, args []string, all boo } return call.ReplyGetVolumes(volumes) } + +// VolumesPrune removes unused images via a varlink call +func (i *LibpodAPI) VolumesPrune(call iopodman.VarlinkCall) error { + var errs []string + prunedNames, prunedErrors := i.Runtime.PruneVolumes(getContext()) + if len(prunedErrors) == 0 { + return call.ReplyVolumesPrune(prunedNames, []string{}) + } + + // We need to take the errors and capture their strings to go back over + // varlink + for _, e := range prunedErrors { + errs = append(errs, e.Error()) + } + return call.ReplyVolumesPrune(prunedNames, errs) +} |