summaryrefslogtreecommitdiff
path: root/libpod/container_inspect.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-06-18 09:38:01 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-06-18 09:38:01 -0400
commitdc4d20b5739d953444a55b1f731c5ec4cc3231f5 (patch)
tree0ac312ce6d9b42d4428599a1a7ecbb948896f14a /libpod/container_inspect.go
parent265d55edbf698b624adee081a48f47b3b73b6164 (diff)
downloadpodman-dc4d20b5739d953444a55b1f731c5ec4cc3231f5.tar.gz
podman-dc4d20b5739d953444a55b1f731c5ec4cc3231f5.tar.bz2
podman-dc4d20b5739d953444a55b1f731c5ec4cc3231f5.zip
Swap to using the on-disk spec for inspect mounts
When available, using the on-disk spec will show full mount options in use when the container is running, which can differ from mount options provided in the original spec - on generating the final spec, for example, we ensure that some form of root propagation is set. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/container_inspect.go')
-rw-r--r--libpod/container_inspect.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/libpod/container_inspect.go b/libpod/container_inspect.go
index 0a62ceb7c..361e170f2 100644
--- a/libpod/container_inspect.go
+++ b/libpod/container_inspect.go
@@ -192,7 +192,7 @@ func (c *Container) getContainerInspectData(size bool, driverData *driver.Data)
}
}
- mounts, err := c.getInspectMounts()
+ mounts, err := c.getInspectMounts(spec)
if err != nil {
return nil, err
}
@@ -302,7 +302,7 @@ func (c *Container) getContainerInspectData(size bool, driverData *driver.Data)
// Get inspect-formatted mounts list.
// Only includes user-specified mounts. Only includes bind mounts and named
// volumes, not tmpfs volumes.
-func (c *Container) getInspectMounts() ([]*InspectMount, error) {
+func (c *Container) getInspectMounts(ctrSpec *spec.Spec) ([]*InspectMount, error) {
inspectMounts := []*InspectMount{}
// No mounts, return early
@@ -319,7 +319,7 @@ func (c *Container) getInspectMounts() ([]*InspectMount, error) {
for _, namedVol := range c.config.NamedVolumes {
namedVolumes[namedVol.Dest] = namedVol
}
- for _, mount := range c.config.Spec.Mounts {
+ for _, mount := range ctrSpec.Mounts {
mounts[mount.Destination] = mount
}