mirror of
https://github.com/containers/podman.git
synced 2025-06-25 20:26:51 +08:00
Merge pull request #15323 from rhatdan/warn
Don't warn on '/' not being shared while in a container
This commit is contained in:
@ -251,20 +251,22 @@ func becomeRootInUserNS(pausePid, fileToRead string, fileOutput *os.File) (_ boo
|
|||||||
return false, 0, nil
|
return false, 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if mounts, err := pmount.GetMounts(); err == nil {
|
if _, inContainer := os.LookupEnv("container"); !inContainer {
|
||||||
for _, m := range mounts {
|
if mounts, err := pmount.GetMounts(); err == nil {
|
||||||
if m.Mountpoint == "/" {
|
for _, m := range mounts {
|
||||||
isShared := false
|
if m.Mountpoint == "/" {
|
||||||
for _, o := range strings.Split(m.Optional, ",") {
|
isShared := false
|
||||||
if strings.HasPrefix(o, "shared:") {
|
for _, o := range strings.Split(m.Optional, ",") {
|
||||||
isShared = true
|
if strings.HasPrefix(o, "shared:") {
|
||||||
break
|
isShared = true
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if !isShared {
|
||||||
|
logrus.Warningf("%q is not a shared mount, this could cause issues or missing mounts with rootless containers", m.Mountpoint)
|
||||||
|
}
|
||||||
|
break
|
||||||
}
|
}
|
||||||
if !isShared {
|
|
||||||
logrus.Warningf("%q is not a shared mount, this could cause issues or missing mounts with rootless containers", m.Mountpoint)
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user