diff options
author | baude <bbaude@redhat.com> | 2019-02-11 15:36:24 -0600 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2019-02-14 10:55:05 -0600 |
commit | 5be818e715d57f98e4a930632bc599e3fee3aaed (patch) | |
tree | cde8eb83111a17d6c081c4f25cae4d751b6313a5 /pkg | |
parent | 0cd22435964573231ab32e545d5f319821b35b14 (diff) | |
download | podman-5be818e715d57f98e4a930632bc599e3fee3aaed.tar.gz podman-5be818e715d57f98e4a930632bc599e3fee3aaed.tar.bz2 podman-5be818e715d57f98e4a930632bc599e3fee3aaed.zip |
enable podman-remote volume prune
allow users to remotely prune volumes.
this is the last volume command for remote enablement. as such,
the volume commands are being folded back into main because they
are supported for both local and remote clients.
also, enable all volume tests that do not use containers
as containers are not enabled for the remote client yet.
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'pkg')
-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) +} |