Ignore not exist errors for joining default subsystems
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
parent
b0481297a1
commit
f95367f57f
2 changed files with 24 additions and 12 deletions
|
@ -2,7 +2,7 @@ package cgroups
|
|||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"errors"
|
||||
"github.com/dotcloud/docker/pkg/mount"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
|
@ -11,6 +11,10 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
var (
|
||||
ErrNotFound = errors.New("mountpoint not found")
|
||||
)
|
||||
|
||||
type Cgroup struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Parent string `json:"parent,omitempty"`
|
||||
|
@ -44,7 +48,7 @@ func FindCgroupMountpoint(subsystem string) (string, error) {
|
|||
}
|
||||
}
|
||||
}
|
||||
return "", fmt.Errorf("cgroup mountpoint not found for %s", subsystem)
|
||||
return "", ErrNotFound
|
||||
}
|
||||
|
||||
// Returns the relative path to the cgroup docker is running in.
|
||||
|
@ -82,7 +86,7 @@ func parseCgroupFile(subsystem string, r io.Reader) (string, error) {
|
|||
}
|
||||
}
|
||||
}
|
||||
return "", fmt.Errorf("cgroup '%s' not found in /proc/self/cgroup", subsystem)
|
||||
return "", ErrNotFound
|
||||
}
|
||||
|
||||
func writeFile(dir, file, data string) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue