summaryrefslogtreecommitdiff
path: root/pkg/varlinkapi
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-10-21 22:20:40 +0200
committerGitHub <noreply@github.com>2019-10-21 22:20:40 +0200
commitefc54c3987f95fd94b5e0aa41dd307be49d1b31b (patch)
tree1820209fcc96b950caac0fc7a9a45c0b75a10823 /pkg/varlinkapi
parentd2591a54335424263374a919d485712e5b8aa093 (diff)
parent03da8b641df1c03aea6f9faa3ddc2b0df64ec68b (diff)
downloadpodman-efc54c3987f95fd94b5e0aa41dd307be49d1b31b.tar.gz
podman-efc54c3987f95fd94b5e0aa41dd307be49d1b31b.tar.bz2
podman-efc54c3987f95fd94b5e0aa41dd307be49d1b31b.zip
Merge pull request #4284 from mheon/fix_vol_inspect
Show volume options in 'volume inspect'
Diffstat (limited to 'pkg/varlinkapi')
-rw-r--r--pkg/varlinkapi/volumes.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/pkg/varlinkapi/volumes.go b/pkg/varlinkapi/volumes.go
index b41eb5086..0ba76902e 100644
--- a/pkg/varlinkapi/volumes.go
+++ b/pkg/varlinkapi/volumes.go
@@ -3,6 +3,8 @@
package varlinkapi
import (
+ "encoding/json"
+
"github.com/containers/libpod/cmd/podman/shared"
"github.com/containers/libpod/cmd/podman/varlink"
"github.com/containers/libpod/libpod"
@@ -80,6 +82,23 @@ func (i *LibpodAPI) GetVolumes(call iopodman.VarlinkCall, args []string, all boo
return call.ReplyGetVolumes(volumes)
}
+// InspectVolume inspects a single volume, returning its JSON as a string.
+func (i *LibpodAPI) InspectVolume(call iopodman.VarlinkCall, name string) error {
+ vol, err := i.Runtime.LookupVolume(name)
+ if err != nil {
+ return call.ReplyErrorOccurred(err.Error())
+ }
+ inspectOut, err := vol.Inspect()
+ if err != nil {
+ return call.ReplyErrorOccurred(err.Error())
+ }
+ inspectJSON, err := json.Marshal(inspectOut)
+ if err != nil {
+ return call.ReplyErrorOccurred(err.Error())
+ }
+ return call.ReplyInspectVolume(string(inspectJSON))
+}
+
// VolumesPrune removes unused images via a varlink call
func (i *LibpodAPI) VolumesPrune(call iopodman.VarlinkCall) error {
var errs []string