From 3c5ce9b8bfabc737822861583ede4807f245d7ab Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Mon, 23 Jul 2018 16:30:23 -0400 Subject: Update container Mounted() and Mountpoint() functions Addresses a regression in `podman mount` due to our mount changes to allow concurrency by letting c/storage handle mounting and unmounting. Combine Mounted() and Mountpoint() into one function and query c/storage directly to ensure we get accurate information. Fixes: #1143 Signed-off-by: Matthew Heon Closes: #1144 Approved by: baude --- cmd/podman/mount.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cmd') diff --git a/cmd/podman/mount.go b/cmd/podman/mount.go index b053ef1e8..df1bacc5f 100644 --- a/cmd/podman/mount.go +++ b/cmd/podman/mount.go @@ -105,13 +105,15 @@ func mountCmd(c *cli.Context) error { return errors.Wrapf(err2, "error reading list of all containers") } for _, container := range containers { - mountPoint, err := container.Mountpoint() + mounted, mountPoint, err := container.Mounted() if err != nil { return errors.Wrapf(err, "error getting mountpoint for %q", container.ID()) } - if mountPoint == "" { + + if !mounted { continue } + if json { jsonMountPoints = append(jsonMountPoints, jsonMountPoint{ID: container.ID(), Names: []string{container.Name()}, MountPoint: mountPoint}) continue -- cgit v1.2.3-54-g00ecf