Skip to content

Commit

Permalink
Merge pull request #4272 from baude/rootlesstatsnet
Browse files Browse the repository at this point in the history
rootless v2 cannot collect network stats
  • Loading branch information
openshift-merge-robot authored Oct 16, 2019
2 parents 1137c10 + f10f9bc commit 7b54aeb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/podman-stats.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Note: Podman stats will not work in rootless environments that use CGroups V1.
Podman stats relies on CGroup information for statistics, and CGroup v1 is not
supported for rootless use cases.

Note: Rootless environments that use CGroups V2 are not able to report statistics
about their networking usage.

## OPTIONS

**--all**, **-a**
Expand Down
6 changes: 6 additions & 0 deletions libpod/networking_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7b54aeb

Please sign in to comment.