summaryrefslogtreecommitdiff
path: root/libpod/stats.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-10-01 12:10:46 -0500
committerbaude <bbaude@redhat.com>2018-10-03 12:45:37 -0500
commit14473270d7af520dae006605ab798ad9db34f184 (patch)
tree3224b4b540df5adccc615f5adede8c3e3db7eb90 /libpod/stats.go
parent230edff5216d0a7cedeff06c891450f8691b5aa2 (diff)
downloadpodman-14473270d7af520dae006605ab798ad9db34f184.tar.gz
podman-14473270d7af520dae006605ab798ad9db34f184.tar.bz2
podman-14473270d7af520dae006605ab798ad9db34f184.zip
Add ability for ubuntu to be tested
unfortunately the papr CI system cannot test ubuntu as a VM; therefore, this PR still keeps travis. but it does include fixes that will be required for running on modern versions of ubuntu. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'libpod/stats.go')
-rw-r--r--libpod/stats.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/libpod/stats.go b/libpod/stats.go
index 9d5efd993..c58a46135 100644
--- a/libpod/stats.go
+++ b/libpod/stats.go
@@ -33,13 +33,14 @@ func (c *Container) GetContainerStats(previousStats *ContainerStats) (*Container
if err != nil {
return nil, err
}
-
- cgroup, err := cgroups.Load(cgroups.V1, cgroups.StaticPath(cgroupPath))
+ v1CGroups := GetV1CGroups(getExcludedCGroups())
+ cgroup, err := cgroups.Load(v1CGroups, cgroups.StaticPath(cgroupPath))
if err != nil {
return stats, errors.Wrapf(err, "unable to load cgroup at %s", cgroupPath)
}
- cgroupStats, err := cgroup.Stat()
+ // Ubuntu does not have swap memory in cgroups because swap is often not enabled.
+ cgroupStats, err := cgroup.Stat(cgroups.IgnoreNotExist)
if err != nil {
return stats, errors.Wrapf(err, "unable to obtain cgroup stats")
}