Fix docker status incorrectly reports containerized. Fixes #17037

Signed-off-by: Peter Malmgren <ptmalmgren@gmail.com>
This commit is contained in:
Peter Malmgren 2015-10-28 02:00:07 +00:00
parent 9f0f24ea63
commit 39e1568228
2 changed files with 23 additions and 2 deletions

View file

@ -36,7 +36,7 @@ func IsContainerized() (bool, error) {
return false, err
}
for _, line := range bytes.Split(b, []byte{'\n'}) {
if len(line) > 0 && !bytes.HasSuffix(line, []byte{'/'}) {
if len(line) > 0 && !bytes.HasSuffix(line, []byte{'/'}) && !bytes.HasSuffix(line, []byte("init.scope")) {
return true, nil
}
}