Fix removing state recover.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2017-10-30 04:28:53 +00:00
parent 95067d76a7
commit 4eaaee380f
6 changed files with 63 additions and 20 deletions

View File

@@ -125,7 +125,7 @@ func (em *eventMonitor) handleEvent(evt *events.Envelope) {
// Move on to make sure container status is updated.
}
}
err = cntr.Status.Update(func(status containerstore.Status) (containerstore.Status, error) {
err = cntr.Status.UpdateSync(func(status containerstore.Status) (containerstore.Status, error) {
// If FinishedAt has been set (e.g. with start failure), keep as
// it is.
if status.FinishedAt != 0 {
@@ -151,7 +151,7 @@ func (em *eventMonitor) handleEvent(evt *events.Envelope) {
}
glog.Errorf("Failed to get container %q: %v", e.ContainerID, err)
}
err = cntr.Status.Update(func(status containerstore.Status) (containerstore.Status, error) {
err = cntr.Status.UpdateSync(func(status containerstore.Status) (containerstore.Status, error) {
status.Reason = oomExitReason
return status, nil
})