From 77836a6c27a443269957f0acd30e97865eb516ff Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Mon, 21 Aug 2017 16:17:18 -0400 Subject: [PATCH] Update cgroups to e6d1aa8c71c6103624b2c6e6f4be0863 This bumps the cgroups package with various fixes to logging and net_cls changes. Signed-off-by: Michael Crosby --- vendor.conf | 2 +- vendor/github.com/containerd/cgroups/net_cls.go | 2 +- vendor/github.com/containerd/cgroups/paths.go | 7 +++++-- vendor/github.com/containerd/cgroups/utils.go | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/vendor.conf b/vendor.conf index 11e4cc9d3..a3cb9ba11 100644 --- a/vendor.conf +++ b/vendor.conf @@ -1,7 +1,7 @@ github.com/coreos/go-systemd 48702e0da86bd25e76cfef347e2adeb434a0d0a6 github.com/containerd/go-runc b85ac701de5065a66918203dd18f057433290807 github.com/containerd/console 76d18fd1d66972718ab2284449591db0b3cdb4de -github.com/containerd/cgroups 4fd64a776f25b5540cddcb72eea6e35e58baca6e +github.com/containerd/cgroups e6d1aa8c71c6103624b2c6e6f4be0863b67027f1 github.com/docker/go-metrics 8fd5772bf1584597834c6f7961a530f06cbfbb87 github.com/docker/go-events 9461782956ad83b30282bf90e31fa6a70c255ba9 github.com/godbus/dbus c7fdd8b5cd55e87b4e1f4e372cdb1db61dd6c66f diff --git a/vendor/github.com/containerd/cgroups/net_cls.go b/vendor/github.com/containerd/cgroups/net_cls.go index b5a4802d3..1558444bd 100644 --- a/vendor/github.com/containerd/cgroups/net_cls.go +++ b/vendor/github.com/containerd/cgroups/net_cls.go @@ -33,7 +33,7 @@ func (n *netclsController) Create(path string, resources *specs.LinuxResources) } if resources.Network != nil && resources.Network.ClassID != nil && *resources.Network.ClassID > 0 { return ioutil.WriteFile( - filepath.Join(n.Path(path), "net_cls_classid_u"), + filepath.Join(n.Path(path), "net_cls.classid"), []byte(strconv.FormatUint(uint64(*resources.Network.ClassID), 10)), defaultFilePerm, ) diff --git a/vendor/github.com/containerd/cgroups/paths.go b/vendor/github.com/containerd/cgroups/paths.go index 63ac270fb..1afc24b66 100644 --- a/vendor/github.com/containerd/cgroups/paths.go +++ b/vendor/github.com/containerd/cgroups/paths.go @@ -3,6 +3,8 @@ package cgroups import ( "fmt" "path/filepath" + + "github.com/pkg/errors" ) type Path func(subsystem Name) (string, error) @@ -31,9 +33,10 @@ func NestedPath(suffix string) Path { // PidPath will return the correct cgroup paths for an existing process running inside a cgroup // This is commonly used for the Load function to restore an existing container func PidPath(pid int) Path { - paths, err := parseCgroupFile(fmt.Sprintf("/proc/%d/cgroup", pid)) + p := fmt.Sprintf("/proc/%d/cgroup", pid) + paths, err := parseCgroupFile(p) if err != nil { - return errorPath(err) + return errorPath(errors.Wrapf(err, "parse cgroup file %s", p)) } return existingPath(paths, "") } diff --git a/vendor/github.com/containerd/cgroups/utils.go b/vendor/github.com/containerd/cgroups/utils.go index c3b8be8e0..d5c7230a0 100644 --- a/vendor/github.com/containerd/cgroups/utils.go +++ b/vendor/github.com/containerd/cgroups/utils.go @@ -81,8 +81,8 @@ func defaults(root string) ([]Subsystem, error) { // remove will remove a cgroup path handling EAGAIN and EBUSY errors and // retrying the remove after a exp timeout func remove(path string) error { + delay := 10 * time.Millisecond for i := 0; i < 5; i++ { - delay := 10 * time.Millisecond if i != 0 { time.Sleep(delay) delay *= 2 @@ -204,7 +204,7 @@ func parseCgroupFromReader(r io.Reader) (map[string]string, error) { parts = strings.SplitN(text, ":", 3) ) if len(parts) < 3 { - return nil, fmt.Errorf("invalid cgroup entry: must contain at least two colons: %v", text) + return nil, fmt.Errorf("invalid cgroup entry: %q", text) } for _, subs := range strings.Split(parts[1], ",") { if subs != "" {