Dont fail on missing subsystem for systemd stats

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
This commit is contained in:
Michael Crosby 2014-07-11 12:05:59 -07:00
parent 50106c7490
commit 7e1cfc1f6a
2 changed files with 6 additions and 0 deletions

View File

@ -75,6 +75,7 @@ func GetStats(c *cgroups.Cgroup) (*cgroups.Stats, error) {
if err == cgroups.ErrNotFound {
continue
}
return nil, err
}

View File

@ -422,6 +422,11 @@ func GetStats(c *cgroups.Cgroup) (*cgroups.Stats, error) {
for sysname, sys := range subsystems {
subsystemPath, err := getSubsystemPath(c, sysname)
if err != nil {
// Don't fail if a cgroup hierarchy was not found, just skip this subsystem
if err == cgroups.ErrNotFound {
continue
}
return nil, err
}