7511f16a580e0079af80c6213a6d3da810393761
This fix tries to fix the issue in #21848 where `docker stats` will not correctly display the container stats in case the container reuse another container's network stack. The issue is that when `stats` is performed, the daemon will check for container network setting's `SandboxID`. Unfortunately, for containers that reuse another container's network stack (`NetworkMode.IsConnected()`), SandboxID is not assigned. Therefore, the daemon thinks the id is invalid and remote API will never return. This fix tries to resolve the SandboxID by iterating through connected containers and identify the appropriate SandboxID. A test case for `stats` remote API has been added to check if `stats` will return within the timeout. This fix fixes #21848. Signed-off-by: Yong Tang <yong.tang.github@outlook.com> Upstream-commit: faf2b6f7aaca7f9ef400e227921b8125590fc9e5 Component: engine
Description
No description provided
Languages
Go
92%
Shell
5.5%
Dockerfile
1.1%
Go-Checksums
0.9%
Makefile
0.3%
Other
0.2%