Merge pull request #29747 from xlgao-zju/break-the-for
exit collect when we get EOF
This commit is contained in:
commit
3c64061b67
1 changed files with 4 additions and 2 deletions
|
@ -152,11 +152,13 @@ func collect(ctx context.Context, s *formatter.ContainerStats, cli client.APICli
|
||||||
waitFirst.Done()
|
waitFirst.Done()
|
||||||
}
|
}
|
||||||
case err := <-u:
|
case err := <-u:
|
||||||
if err != nil {
|
|
||||||
s.SetError(err)
|
s.SetError(err)
|
||||||
|
if err == io.EOF {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
s.SetError(nil)
|
|
||||||
// if this is the first stat you get, release WaitGroup
|
// if this is the first stat you get, release WaitGroup
|
||||||
if !getFirst {
|
if !getFirst {
|
||||||
getFirst = true
|
getFirst = true
|
||||||
|
|
Loading…
Reference in a new issue