exit collect when we get EOF
| ... | ... |
@@ -152,11 +152,13 @@ func collect(ctx context.Context, s *formatter.ContainerStats, cli client.APICli |
| 152 | 152 |
waitFirst.Done() |
| 153 | 153 |
} |
| 154 | 154 |
case err := <-u: |
| 155 |
+ s.SetError(err) |
|
| 156 |
+ if err == io.EOF {
|
|
| 157 |
+ break |
|
| 158 |
+ } |
|
| 155 | 159 |
if err != nil {
|
| 156 |
- s.SetError(err) |
|
| 157 | 160 |
continue |
| 158 | 161 |
} |
| 159 |
- s.SetError(nil) |
|
| 160 | 162 |
// if this is the first stat you get, release WaitGroup |
| 161 | 163 |
if !getFirst {
|
| 162 | 164 |
getFirst = true |