Merge pull request #1985 from dongluochen/RefreshContainerAtTransitState

Force inspect for containers in Restarting state
This commit is contained in:
Nishant Totla 2016-03-17 02:07:11 -07:00
commit 73179d4dd8
1 changed files with 5 additions and 0 deletions

View File

@ -640,6 +640,11 @@ func (e *Engine) updateContainer(c dockerclient.Container, containers map[string
if current, exists := e.containers[c.Id]; exists { if current, exists := e.containers[c.Id]; exists {
// The container is already known. // The container is already known.
container = current container = current
// Restarting is a transit state. Unfortunately Docker doesn't always emit
// events when it gets out of Restarting state. Force an inspect to update.
if container.Info.State != nil && container.Info.State.Restarting {
full = true
}
} else { } else {
// This is a brand new container. We need to do a full refresh. // This is a brand new container. We need to do a full refresh.
container = &Container{ container = &Container{