Merge pull request #15323 from rhatdan/warn

Don't warn on '/' not being shared while in a container
This commit is contained in:
OpenShift Merge Robot 2022-08-15 18:31:07 +00:00 committed by GitHub
commit c649490d3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 12 deletions

View File

@ -251,6 +251,7 @@ func becomeRootInUserNS(pausePid, fileToRead string, fileOutput *os.File) (_ boo
return false, 0, nil
}
if _, inContainer := os.LookupEnv("container"); !inContainer {
if mounts, err := pmount.GetMounts(); err == nil {
for _, m := range mounts {
if m.Mountpoint == "/" {
@ -268,6 +269,7 @@ func becomeRootInUserNS(pausePid, fileToRead string, fileOutput *os.File) (_ boo
}
}
}
}
cPausePid := C.CString(pausePid)
defer C.free(unsafe.Pointer(cPausePid))