diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-09-09 21:48:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-09 21:48:30 +0200 |
commit | 9a55bce9e4d7e1bb3d57dc8879e1a23f559e18ba (patch) | |
tree | b048b0e2228fa9ae67c9a73bd4fecf1739f64d75 /pkg/varlinkapi | |
parent | 7042a3d7a539bae79ed63bdc87f432b8ec73afd8 (diff) | |
parent | 046178e55f72ed9db7cf5898d3be91b0112ab94f (diff) | |
download | podman-9a55bce9e4d7e1bb3d57dc8879e1a23f559e18ba.tar.gz podman-9a55bce9e4d7e1bb3d57dc8879e1a23f559e18ba.tar.bz2 podman-9a55bce9e4d7e1bb3d57dc8879e1a23f559e18ba.zip |
Merge pull request #3896 from mheon/volume_lookup
Add ability to look up volumes by unambiguous partial name
Diffstat (limited to 'pkg/varlinkapi')
-rw-r--r-- | pkg/varlinkapi/volumes.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pkg/varlinkapi/volumes.go b/pkg/varlinkapi/volumes.go index 6dd86d831..b41eb5086 100644 --- a/pkg/varlinkapi/volumes.go +++ b/pkg/varlinkapi/volumes.go @@ -3,6 +3,7 @@ package varlinkapi import ( + "github.com/containers/libpod/cmd/podman/shared" "github.com/containers/libpod/cmd/podman/varlink" "github.com/containers/libpod/libpod" ) @@ -32,11 +33,16 @@ func (i *LibpodAPI) VolumeCreate(call iopodman.VarlinkCall, options iopodman.Vol // VolumeRemove removes volumes by options.All or options.Volumes func (i *LibpodAPI) VolumeRemove(call iopodman.VarlinkCall, options iopodman.VolumeRemoveOpts) error { - deletedVolumes, err := i.Runtime.RemoveVolumes(getContext(), options.Volumes, options.All, options.Force) + success, failed, err := shared.SharedRemoveVolumes(getContext(), i.Runtime, options.Volumes, options.All, options.Force) if err != nil { return call.ReplyErrorOccurred(err.Error()) } - return call.ReplyVolumeRemove(deletedVolumes) + // Convert map[string]string to map[string]error + errStrings := make(map[string]string) + for k, v := range failed { + errStrings[k] = v.Error() + } + return call.ReplyVolumeRemove(success, errStrings) } // GetVolumes returns all the volumes known to the remote system |