summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQi Wang <qiwan@redhat.com>2019-08-13 15:13:10 -0400
committerQi Wang <qiwan@redhat.com>2019-08-13 15:13:20 -0400
commitbc6e1f11366945d15d96e0fc1854b5b9c5e18ee7 (patch)
treed57f65ce1808d616d9e23e021bab62a779ef3006
parentce64c1403df0e4ca75be50e4a835cc0889b0c8ac (diff)
downloadpodman-bc6e1f11366945d15d96e0fc1854b5b9c5e18ee7.tar.gz
podman-bc6e1f11366945d15d96e0fc1854b5b9c5e18ee7.tar.bz2
podman-bc6e1f11366945d15d96e0fc1854b5b9c5e18ee7.zip
removMergeDir from inspect result if not mounted
Remove GraphDriver.Data.MergedDir from the result of podman inspect if the container not mounte. Because the /var/lib/containers/.../merged directory is no longer created by default; it only exists during the scope of podman mount. Signed-off-by: Qi Wang <qiwan@redhat.com>
-rw-r--r--libpod/driver/driver.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/libpod/driver/driver.go b/libpod/driver/driver.go
index f9442fa21..85eda5a21 100644
--- a/libpod/driver/driver.go
+++ b/libpod/driver/driver.go
@@ -38,6 +38,10 @@ func GetDriverData(store cstorage.Store, layerID string) (*Data, error) {
if err != nil {
return nil, err
}
+ if mountTimes, err := store.Mounted(layerID); mountTimes == 0 || err != nil {
+ delete(metaData, "MergedDir")
+ }
+
return &Data{
Name: name,
Data: metaData,