Update cgroups to e6d1aa8c71c6103624b2c6e6f4be0863

This bumps the cgroups package with various fixes to logging and net_cls
changes.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2017-08-21 16:17:18 -04:00
parent 873a34649a
commit 77836a6c27
4 changed files with 9 additions and 6 deletions

View File

@ -1,7 +1,7 @@
github.com/coreos/go-systemd 48702e0da86bd25e76cfef347e2adeb434a0d0a6 github.com/coreos/go-systemd 48702e0da86bd25e76cfef347e2adeb434a0d0a6
github.com/containerd/go-runc b85ac701de5065a66918203dd18f057433290807 github.com/containerd/go-runc b85ac701de5065a66918203dd18f057433290807
github.com/containerd/console 76d18fd1d66972718ab2284449591db0b3cdb4de 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-metrics 8fd5772bf1584597834c6f7961a530f06cbfbb87
github.com/docker/go-events 9461782956ad83b30282bf90e31fa6a70c255ba9 github.com/docker/go-events 9461782956ad83b30282bf90e31fa6a70c255ba9
github.com/godbus/dbus c7fdd8b5cd55e87b4e1f4e372cdb1db61dd6c66f github.com/godbus/dbus c7fdd8b5cd55e87b4e1f4e372cdb1db61dd6c66f

View File

@ -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 { if resources.Network != nil && resources.Network.ClassID != nil && *resources.Network.ClassID > 0 {
return ioutil.WriteFile( 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)), []byte(strconv.FormatUint(uint64(*resources.Network.ClassID), 10)),
defaultFilePerm, defaultFilePerm,
) )

View File

@ -3,6 +3,8 @@ package cgroups
import ( import (
"fmt" "fmt"
"path/filepath" "path/filepath"
"github.com/pkg/errors"
) )
type Path func(subsystem Name) (string, error) 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 // 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 // This is commonly used for the Load function to restore an existing container
func PidPath(pid int) Path { 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 { if err != nil {
return errorPath(err) return errorPath(errors.Wrapf(err, "parse cgroup file %s", p))
} }
return existingPath(paths, "") return existingPath(paths, "")
} }

View File

@ -81,8 +81,8 @@ func defaults(root string) ([]Subsystem, error) {
// remove will remove a cgroup path handling EAGAIN and EBUSY errors and // remove will remove a cgroup path handling EAGAIN and EBUSY errors and
// retrying the remove after a exp timeout // retrying the remove after a exp timeout
func remove(path string) error { func remove(path string) error {
delay := 10 * time.Millisecond
for i := 0; i < 5; i++ { for i := 0; i < 5; i++ {
delay := 10 * time.Millisecond
if i != 0 { if i != 0 {
time.Sleep(delay) time.Sleep(delay)
delay *= 2 delay *= 2
@ -204,7 +204,7 @@ func parseCgroupFromReader(r io.Reader) (map[string]string, error) {
parts = strings.SplitN(text, ":", 3) parts = strings.SplitN(text, ":", 3)
) )
if len(parts) < 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], ",") { for _, subs := range strings.Split(parts[1], ",") {
if subs != "" { if subs != "" {