Skip to content

Commit

Permalink
Fix duplicate entries and missing entries in getCgroupMountsHelper
Browse files Browse the repository at this point in the history
Signed-off-by: Jay Kamat <[email protected]>
  • Loading branch information
jgkamat committed Aug 1, 2018
1 parent e5a7c61 commit a2faaa1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libcontainer/cgroups/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,16 @@ func getCgroupMountsHelper(ss map[string]bool, mi io.Reader, all bool) ([]Mount,
if !known || (!all && seen) {
continue
}
ss[opt] = true
if strings.HasPrefix(opt, cgroupNamePrefix) {
opt = opt[len(cgroupNamePrefix):]
}
m.Subsystems = append(m.Subsystems, opt)
ss[opt] = true
numFound++
}
res = append(res, m)
if len(m.Subsystems) > 0 || all {
res = append(res, m)
}
}
if err := scanner.Err(); err != nil {
return nil, err
Expand Down

0 comments on commit a2faaa1

Please sign in to comment.