server: still update status on container not found in runc

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2017-05-11 14:14:15 +02:00
parent 358dac96d4
commit 6622feb480
No known key found for this signature in database
GPG key ID: B2BEAD150DE936B9

View file

@ -521,6 +521,9 @@ func (r *Runtime) UpdateStatus(c *Container) error {
out, err := exec.Command(r.Path(c), "state", c.name).CombinedOutput()
if err != nil {
if err := unix.Kill(c.state.Pid, 0); err == syscall.ESRCH {
c.state.Status = ContainerStateStopped
c.state.Finished = time.Now()
c.state.ExitCode = 255
return nil
}
return fmt.Errorf("error getting container state for %s: %s: %q", c.name, err, out)