Set Container Status Reason when OOM Killed

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
Mrunal Patel 2017-05-23 14:04:10 -07:00
parent 52b27da680
commit ea9a90abce
4 changed files with 14 additions and 4 deletions

View file

@ -552,6 +552,11 @@ func (r *Runtime) UpdateStatus(c *Container) error {
}
c.state.ExitCode = int32(statusCode)
}
oomFilePath := filepath.Join(c.bundlePath, "oom")
if _, err = os.Stat(oomFilePath); err == nil {
c.state.OOMKilled = true
}
}
return nil