Update containerd dependencies

sys/unix
cgroups
go-runc
console

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-07-07 11:46:54 -07:00
parent b9fb2793a8
commit d46b562043
51 changed files with 508 additions and 196 deletions

View File

@@ -245,6 +245,9 @@ func (c *cgroup) processes(subsystem Name, recursive bool) ([]Process, error) {
return err
}
if !recursive && info.IsDir() {
if p == path {
return nil
}
return filepath.SkipDir
}
dir, name := filepath.Split(p)

View File

@@ -84,15 +84,14 @@ func (c *cpusetController) ensureParent(current, root string) error {
if _, err := filepath.Rel(root, parent); err != nil {
return nil
}
if cleanPath(parent) == root {
return nil
}
// Avoid infinite recursion.
if parent == current {
return fmt.Errorf("cpuset: cgroup parent path outside cgroup root")
}
if err := c.ensureParent(parent, root); err != nil {
return err
if cleanPath(parent) != root {
if err := c.ensureParent(parent, root); err != nil {
return err
}
}
if err := os.MkdirAll(current, defaultDirPerm); err != nil {
return err

View File

@@ -1,5 +1,10 @@
package cgroups
func getClockTicks() uint64 {
// The value comes from `C.sysconf(C._SC_CLK_TCK)`, and
// on Linux it's a constant which is safe to be hard coded,
// so we can avoid using cgo here.
// See https://github.com/containerd/cgroups/pull/12 for
// more details.
return 100
}

View File

@@ -207,7 +207,9 @@ func parseCgroupFromReader(r io.Reader) (map[string]string, error) {
return nil, fmt.Errorf("invalid cgroup entry: must contain at least two colons: %v", text)
}
for _, subs := range strings.Split(parts[1], ",") {
cgroups[subs] = parts[2]
if subs != "" {
cgroups[subs] = parts[2]
}
}
}
return cgroups, nil