mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #28026 from ripcurld00d/fix_27772
Return an empty stats if the container is restarting
This commit is contained in:
commit
baa14c0e61
1 changed files with 2 additions and 2 deletions
|
@ -31,8 +31,8 @@ func (daemon *Daemon) ContainerStats(ctx context.Context, prefixOrName string, c
|
|||
return err
|
||||
}
|
||||
|
||||
// If the container is not running and requires no stream, return an empty stats.
|
||||
if !container.IsRunning() && !config.Stream {
|
||||
// If the container is either not running or restarting and requires no stream, return an empty stats.
|
||||
if (!container.IsRunning() || container.IsRestarting()) && !config.Stream {
|
||||
return json.NewEncoder(config.OutStream).Encode(&types.Stats{})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue