From 9e22fbf6796c58b9fc3716722c23550eb50a6bd1 Mon Sep 17 00:00:00 2001 From: baude Date: Tue, 29 Jan 2019 15:56:18 -0600 Subject: Alter varlink API for ListContainerMounts to return a map We want to return a map of containermounts where the key is container id and it points to the mountpath. Issue #2215 Signed-off-by: baude --- pkg/varlinkapi/mount.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg') diff --git a/pkg/varlinkapi/mount.go b/pkg/varlinkapi/mount.go index 84e6b2709..3b4fe87e3 100644 --- a/pkg/varlinkapi/mount.go +++ b/pkg/varlinkapi/mount.go @@ -6,7 +6,7 @@ import ( // ListContainerMounts ... func (i *LibpodAPI) ListContainerMounts(call iopodman.VarlinkCall) error { - var mounts []string + mounts := make(map[string]string) allContainers, err := i.Runtime.GetAllContainers() if err != nil { return call.ReplyErrorOccurred(err.Error()) @@ -17,7 +17,7 @@ func (i *LibpodAPI) ListContainerMounts(call iopodman.VarlinkCall) error { return call.ReplyErrorOccurred(err.Error()) } if mounted { - mounts = append(mounts, mountPoint) + mounts[container.ID()] = mountPoint } } return call.ReplyListContainerMounts(mounts) -- cgit v1.2.3-54-g00ecf