rootless: correctly propagate the exit status from the container

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano
2018-07-11 09:49:30 +02:00
parent 0066374fc3
commit 62e48e5b71
4 changed files with 24 additions and 21 deletions

View File

@@ -27,13 +27,13 @@ func main() {
debug := false
cpuProfile := false
became, err := rootless.BecomeRootInUserNS()
became, ret, err := rootless.BecomeRootInUserNS()
if err != nil {
logrus.Errorf(err.Error())
os.Exit(1)
}
if became {
os.Exit(0)
os.Exit(ret)
}
if reexec.Init() {