summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-10-15 14:00:18 -0500
committerbaude <bbaude@redhat.com>2019-10-15 14:09:41 -0500
commitf10f9bc58fa0a8863aa2502221795b69e7b8bd0e (patch)
treec9e7c43289a3825c557240c7de504f6594fd4473 /libpod
parent5f72e6ef2ef7b6941cefc3c655903aeacb53e115 (diff)
downloadpodman-f10f9bc58fa0a8863aa2502221795b69e7b8bd0e.tar.gz
podman-f10f9bc58fa0a8863aa2502221795b69e7b8bd0e.tar.bz2
podman-f10f9bc58fa0a8863aa2502221795b69e7b8bd0e.zip
rootless v2 cannot collect network stats
network statistics cannot be collected for rootless network devices with the current implementation. for now, we return nil so that stats will at least for users. Fixes:#4268 Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/networking_linux.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go
index 8181cbc8a..4360c8c15 100644
--- a/libpod/networking_linux.go
+++ b/libpod/networking_linux.go
@@ -462,6 +462,12 @@ func getContainerNetNS(ctr *Container) (string, error) {
func getContainerNetIO(ctr *Container) (*netlink.LinkStatistics, error) {
var netStats *netlink.LinkStatistics
+ // rootless v2 cannot seem to resolve its network connection to
+ // collect statistics. For now, we allow stats to at least run
+ // by returning nil
+ if rootless.IsRootless() {
+ return netStats, nil
+ }
netNSPath, netPathErr := getContainerNetNS(ctr)
if netPathErr != nil {
return nil, netPathErr