mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix inspect Dead container
Signed-off-by: Lei Jitang <leijitang@huawei.com>
This commit is contained in:
parent
d2fa978d4d
commit
c35186b0b9
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue