summaryrefslogtreecommitdiff
path: root/libpod/container_inspect.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-10-29 18:15:24 +0100
committerGitHub <noreply@github.com>2020-10-29 18:15:24 +0100
commitc8f0e1dab602ed94af95dc4f604f161696f249e0 (patch)
tree1d8fe4e091300aa7c2c6e61fcb1a509c382974b0 /libpod/container_inspect.go
parente439aec4fa867cda0672079dac0fe394dfb3306c (diff)
parent65a618886efc48562e5b9ff99ca630c83622419b (diff)
downloadpodman-c8f0e1dab602ed94af95dc4f604f161696f249e0.tar.gz
podman-c8f0e1dab602ed94af95dc4f604f161696f249e0.tar.bz2
podman-c8f0e1dab602ed94af95dc4f604f161696f249e0.zip
Merge pull request #8146 from vrothberg/image-mounts
new "image" mount type
Diffstat (limited to 'libpod/container_inspect.go')
-rw-r--r--libpod/container_inspect.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/libpod/container_inspect.go b/libpod/container_inspect.go
index b8bce1272..162f70326 100644
--- a/libpod/container_inspect.go
+++ b/libpod/container_inspect.go
@@ -90,7 +90,7 @@ func (c *Container) getContainerInspectData(size bool, driverData *driver.Data)
}
namedVolumes, mounts := c.sortUserVolumes(ctrSpec)
- inspectMounts, err := c.getInspectMounts(namedVolumes, mounts)
+ inspectMounts, err := c.getInspectMounts(namedVolumes, c.config.ImageVolumes, mounts)
if err != nil {
return nil, err
}
@@ -192,7 +192,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(namedVolumes []*ContainerNamedVolume, mounts []spec.Mount) ([]define.InspectMount, error) {
+func (c *Container) getInspectMounts(namedVolumes []*ContainerNamedVolume, imageVolumes []*ContainerImageVolume, mounts []spec.Mount) ([]define.InspectMount, error) {
inspectMounts := []define.InspectMount{}
// No mounts, return early
@@ -219,6 +219,17 @@ func (c *Container) getInspectMounts(namedVolumes []*ContainerNamedVolume, mount
inspectMounts = append(inspectMounts, mountStruct)
}
+
+ for _, volume := range imageVolumes {
+ mountStruct := define.InspectMount{}
+ mountStruct.Type = "image"
+ mountStruct.Destination = volume.Dest
+ mountStruct.Source = volume.Source
+ mountStruct.RW = volume.ReadWrite
+
+ inspectMounts = append(inspectMounts, mountStruct)
+ }
+
for _, mount := range mounts {
// It's a mount.
// Is it a tmpfs? If so, discard.