diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-07-23 16:30:23 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-07-24 02:25:11 +0000 |
commit | 3c5ce9b8bfabc737822861583ede4807f245d7ab (patch) | |
tree | 0375ea08b7bf397ba7037201891744711dcf8dd7 /libpod/storage.go | |
parent | 9a18681ba62d1a297809c243607a7b3763131c36 (diff) | |
download | podman-3c5ce9b8bfabc737822861583ede4807f245d7ab.tar.gz podman-3c5ce9b8bfabc737822861583ede4807f245d7ab.tar.bz2 podman-3c5ce9b8bfabc737822861583ede4807f245d7ab.zip |
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 <matthew.heon@gmail.com>
Closes: #1144
Approved by: baude
Diffstat (limited to 'libpod/storage.go')
-rw-r--r-- | libpod/storage.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libpod/storage.go b/libpod/storage.go index 76aa9efa4..9c5fc858e 100644 --- a/libpod/storage.go +++ b/libpod/storage.go @@ -263,6 +263,22 @@ func (r *storageService) MountedContainerImage(idOrName string) (int, error) { return mounted, nil } +func (r *storageService) GetMountpoint(id string) (string, error) { + container, err := r.store.Container(id) + if err != nil { + if errors.Cause(err) == storage.ErrContainerUnknown { + return "", ErrNoSuchCtr + } + return "", err + } + layer, err := r.store.Layer(container.LayerID) + if err != nil { + return "", err + } + + return layer.MountPoint, nil +} + func (r *storageService) GetWorkDir(id string) (string, error) { container, err := r.store.Container(id) if err != nil { |