Skip to content

Commit

Permalink
Merge pull request containers#6823 from giuseppe/allow-cgroup-with-co…
Browse files Browse the repository at this point in the history
…lumn-name

utils: fix parsing of cgroup with : in the name
  • Loading branch information
openshift-merge-robot authored Jun 30, 2020
2 parents 6fbd157 + f54408b commit 1a1e3f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/utils_supported.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func getCgroupProcess(procFile string) (string, error) {
cgroup := "/"
for scanner.Scan() {
line := scanner.Text()
parts := strings.Split(line, ":")
parts := strings.SplitN(line, ":", 3)
if len(parts) != 3 {
return "", errors.Errorf("cannot parse cgroup line %q", line)
}
Expand Down Expand Up @@ -116,7 +116,7 @@ func MoveUnderCgroupSubtree(subtree string) error {
scanner := bufio.NewScanner(f)
for scanner.Scan() {
line := scanner.Text()
parts := strings.Split(line, ":")
parts := strings.SplitN(line, ":", 3)
if len(parts) != 3 {
return errors.Errorf("cannot parse cgroup line %q", line)
}
Expand Down

0 comments on commit 1a1e3f4

Please sign in to comment.