Merge pull request #25920 from coolljt0725/fix_inspect_dead

Fix inspect Dead container
Upstream-commit: 8ebb7dba8b25ff3a418791b2df8e3add2b40a669
Component: engine
This commit is contained in:
Vincent Demeester
2016-08-25 17:00:59 +02:00
committed by GitHub

View File

@ -167,7 +167,10 @@ func (daemon *Daemon) getInspectData(container *container.Container, size bool)
contJSONBase.GraphDriver.Name = container.Driver
graphDriverData, err := container.RWLayer.Metadata()
if err != nil {
// If container is marked as Dead, the container's graphdriver metadata
// could have been removed, it will cause error if we try to get the metadata,
// we can ignore the error if the container is dead.
if err != nil && !container.Dead {
return nil, err
}
contJSONBase.GraphDriver.Data = graphDriverData