Skip to content
Permalink
Browse files

merge branch 'pr-2132'

  Support different field counts of cpuaact.stats

LGTMs: @crosbymichael @cyphar
Closes #2132
  • Loading branch information...
cyphar committed Oct 1, 2019
2 parents ba16a38 + 28e58a0 commit 1b8a1eeec3f337ab5d94f289800b30835f2e5453
Showing with 2 additions and 2 deletions.
  1. +2 −2 libcontainer/cgroups/fs/cpuacct.go
@@ -85,8 +85,8 @@ func getCpuUsageBreakdown(path string) (uint64, uint64, error) {
return 0, 0, err
}
fields := strings.Fields(string(data))
if len(fields) != 4 {
return 0, 0, fmt.Errorf("failure - %s is expected to have 4 fields", filepath.Join(path, cgroupCpuacctStat))
if len(fields) < 4 {
return 0, 0, fmt.Errorf("failure - %s is expected to have at least 4 fields", filepath.Join(path, cgroupCpuacctStat))
}
if fields[0] != userField {
return 0, 0, fmt.Errorf("unexpected field %q in %q, expected %q", fields[0], cgroupCpuacctStat, userField)

0 comments on commit 1b8a1ee

Please sign in to comment.
You can’t perform that action at this time.