Merge pull request #2586 from hakman/fix-imagef-detection
Fix incorrect detection of images path
This commit is contained in:
commit
71fa79d18e
3
fs/fs.go
3
fs/fs.go
@ -329,7 +329,8 @@ func (i *RealFsInfo) updateContainerImagesPath(label string, mounts []mount.Moun
|
|||||||
for _, m := range mounts {
|
for _, m := range mounts {
|
||||||
if _, ok := containerImagePaths[m.MountPoint]; ok {
|
if _, ok := containerImagePaths[m.MountPoint]; ok {
|
||||||
if useMount == nil || (len(useMount.MountPoint) < len(m.MountPoint)) {
|
if useMount == nil || (len(useMount.MountPoint) < len(m.MountPoint)) {
|
||||||
useMount = &m
|
useMount = new(mount.MountInfo)
|
||||||
|
*useMount = m
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -360,6 +360,22 @@ func TestAddDockerImagesLabel(t *testing.T) {
|
|||||||
expectedDockerDevice string
|
expectedDockerDevice string
|
||||||
expectedPartition *partition
|
expectedPartition *partition
|
||||||
}{
|
}{
|
||||||
|
{
|
||||||
|
name: "single partition, no dedicated image fs",
|
||||||
|
mounts: []mount.MountInfo{
|
||||||
|
{
|
||||||
|
Source: "/dev/root",
|
||||||
|
MountPoint: "/",
|
||||||
|
FsType: "ext4",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Source: "/sys/fs/cgroup",
|
||||||
|
MountPoint: "/sys/fs/cgroup",
|
||||||
|
FsType: "tmpfs",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
expectedDockerDevice: "/dev/root",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "devicemapper, not loopback",
|
name: "devicemapper, not loopback",
|
||||||
driver: "devicemapper",
|
driver: "devicemapper",
|
||||||
|
Loading…
Reference in New Issue
Block a user