summaryrefslogtreecommitdiff
path: root/libpod/storage.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-07-20 12:31:32 -0400
committerGitHub <noreply@github.com>2018-07-20 12:31:32 -0400
commit7944bca4681893971ad6bda4ade4e1b3470b9559 (patch)
treea829606b854c78edccd041f6d911580c24b5356e /libpod/storage.go
parentd433e5612409f9e2207b11b017b1101631a7971b (diff)
parent85db3f09bff68efb0a8509f7470b61604aefb447 (diff)
downloadpodman-7944bca4681893971ad6bda4ade4e1b3470b9559.tar.gz
podman-7944bca4681893971ad6bda4ade4e1b3470b9559.tar.bz2
podman-7944bca4681893971ad6bda4ade4e1b3470b9559.zip
Merge pull request #1104 from rhatdan/mounting
Let containers/storage keep track of mounts
Diffstat (limited to 'libpod/storage.go')
-rw-r--r--libpod/storage.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/libpod/storage.go b/libpod/storage.go
index ff366edf2..76aa9efa4 100644
--- a/libpod/storage.go
+++ b/libpod/storage.go
@@ -248,6 +248,21 @@ func (r *storageService) UnmountContainerImage(idOrName string) (bool, error) {
return mounted, nil
}
+func (r *storageService) MountedContainerImage(idOrName string) (int, error) {
+ if idOrName == "" {
+ return 0, ErrEmptyID
+ }
+ container, err := r.store.Container(idOrName)
+ if err != nil {
+ return 0, err
+ }
+ mounted, err := r.store.Mounted(container.ID)
+ if err != nil {
+ return 0, err
+ }
+ return mounted, nil
+}
+
func (r *storageService) GetWorkDir(id string) (string, error) {
container, err := r.store.Container(id)
if err != nil {