mirror of
https://github.com/clearlinux/docker.git
synced 2026-10-04 15:58:39 +00:00
Merge pull request #10766 from cpuguy83/stats_pull_once
Allow pulling stats once and disconnecting.
This commit is contained in:
+4
-1
@@ -10,7 +10,7 @@ import (
|
||||
"github.com/docker/libcontainer/cgroups"
|
||||
)
|
||||
|
||||
func (daemon *Daemon) ContainerStats(name string, out io.Writer) error {
|
||||
func (daemon *Daemon) ContainerStats(name string, stream bool, out io.Writer) error {
|
||||
updates, err := daemon.SubscribeToContainerStats(name)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -27,6 +27,9 @@ func (daemon *Daemon) ContainerStats(name string, out io.Writer) error {
|
||||
daemon.UnsubscribeToContainerStats(name, updates)
|
||||
return err
|
||||
}
|
||||
if !stream {
|
||||
break
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user