Merge pull request #501 from losinggeneration/fix_cgroup_memory_check

- runtime: strings.Split may return an empty string on no match
Upstream-commit: c34989f1c49fe7d652a48215fa5a6f869245c5e4
Component: engine
This commit is contained in:
Guillaume J. Charmes
2013-05-03 14:29:43 -07:00
+1 -1
View File
@@ -445,7 +445,7 @@ func FindCgroupMountpoint(cgroupType string) (string, error) {
// cgroup /sys/fs/cgroup/devices cgroup rw,relatime,devices 0 0
for _, line := range strings.Split(string(output), "\n") {
parts := strings.Split(line, " ")
if parts[2] == "cgroup" {
if len(parts) == 6 && parts[2] == "cgroup" {
for _, opt := range strings.Split(parts[3], ",") {
if opt == cgroupType {
return parts[1], nil