Update libcontainer to fd0087d3acdc4c5865de1829d4a

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2015-03-23 11:49:02 -07:00
parent 65e21f5703
commit e321ec9807
9 changed files with 16 additions and 36 deletions

View File

@ -75,7 +75,7 @@ rm -rf src/github.com/docker/distribution
mkdir -p src/github.com/docker/distribution mkdir -p src/github.com/docker/distribution
mv tmp-digest src/github.com/docker/distribution/digest mv tmp-digest src/github.com/docker/distribution/digest
clone git github.com/docker/libcontainer 4a72e540feb67091156b907c4700e580a99f5a9d clone git github.com/docker/libcontainer fd0087d3acdc4c5865de1829d4accee5e3ebb658
# see src/github.com/docker/libcontainer/update-vendor.sh which is the "source of truth" for libcontainer deps (just like this file) # see src/github.com/docker/libcontainer/update-vendor.sh which is the "source of truth" for libcontainer deps (just like this file)
rm -rf src/github.com/docker/libcontainer/vendor rm -rf src/github.com/docker/libcontainer/vendor
eval "$(grep '^clone ' src/github.com/docker/libcontainer/update-vendor.sh | grep -v 'github.com/codegangsta/cli' | grep -v 'github.com/Sirupsen/logrus')" eval "$(grep '^clone ' src/github.com/docker/libcontainer/update-vendor.sh | grep -v 'github.com/codegangsta/cli' | grep -v 'github.com/Sirupsen/logrus')"

View File

@ -99,12 +99,11 @@ func (m *Manager) Apply(pid int) error {
// created then join consists of writing the process pids to cgroup.procs // created then join consists of writing the process pids to cgroup.procs
p, err := d.path(name) p, err := d.path(name)
if err != nil { if err != nil {
if cgroups.IsNotFound(err) {
continue
}
return err return err
} }
if !cgroups.PathExists(p) {
continue
}
paths[name] = p paths[name] = p
} }
m.Paths = paths m.Paths = paths

View File

@ -17,12 +17,8 @@ type BlkioGroup struct {
func (s *BlkioGroup) Apply(d *data) error { func (s *BlkioGroup) Apply(d *data) error {
dir, err := d.join("blkio") dir, err := d.join("blkio")
if err != nil { if err != nil && !cgroups.IsNotFound(err) {
if cgroups.IsNotFound(err) { return err
return nil
} else {
return err
}
} }
if err := s.Set(dir, d.c); err != nil { if err := s.Set(dir, d.c); err != nil {

View File

@ -18,11 +18,7 @@ func (s *CpuGroup) Apply(d *data) error {
// on a container basis // on a container basis
dir, err := d.join("cpu") dir, err := d.join("cpu")
if err != nil { if err != nil {
if cgroups.IsNotFound(err) { return err
return nil
} else {
return err
}
} }
if err := s.Set(dir, d.c); err != nil { if err := s.Set(dir, d.c); err != nil {

View File

@ -11,11 +11,7 @@ type DevicesGroup struct {
func (s *DevicesGroup) Apply(d *data) error { func (s *DevicesGroup) Apply(d *data) error {
dir, err := d.join("devices") dir, err := d.join("devices")
if err != nil { if err != nil {
if cgroups.IsNotFound(err) { return err
return nil
} else {
return err
}
} }
if err := s.Set(dir, d.c); err != nil { if err := s.Set(dir, d.c); err != nil {

View File

@ -13,12 +13,8 @@ type FreezerGroup struct {
func (s *FreezerGroup) Apply(d *data) error { func (s *FreezerGroup) Apply(d *data) error {
dir, err := d.join("freezer") dir, err := d.join("freezer")
if err != nil { if err != nil && !cgroups.IsNotFound(err) {
if cgroups.IsNotFound(err) { return err
return nil
} else {
return err
}
} }
if err := s.Set(dir, d.c); err != nil { if err := s.Set(dir, d.c); err != nil {

View File

@ -16,12 +16,9 @@ type MemoryGroup struct {
func (s *MemoryGroup) Apply(d *data) error { func (s *MemoryGroup) Apply(d *data) error {
dir, err := d.join("memory") dir, err := d.join("memory")
if err != nil { // only return an error for memory if it was specified
if cgroups.IsNotFound(err) { if err != nil && (d.c.Memory != 0 || d.c.MemoryReservation != 0 || d.c.MemorySwap != 0) {
return nil return err
} else {
return err
}
} }
defer func() { defer func() {
if err != nil { if err != nil {

View File

@ -91,7 +91,7 @@ func UseSystemd() bool {
ddf := newProp("DefaultDependencies", false) ddf := newProp("DefaultDependencies", false)
if _, err := theConn.StartTransientUnit("docker-systemd-test-default-dependencies.scope", "replace", ddf); err != nil { if _, err := theConn.StartTransientUnit("docker-systemd-test-default-dependencies.scope", "replace", ddf); err != nil {
if dbusError, ok := err.(dbus.Error); ok { if dbusError, ok := err.(dbus.Error); ok {
if dbusError.Name == "org.freedesktop.DBus.Error.PropertyReadOnly" { if strings.Contains(dbusError.Name, "org.freedesktop.DBus.Error.PropertyReadOnly") {
hasTransientDefaultDependencies = false hasTransientDefaultDependencies = false
} }
} }

View File

@ -659,7 +659,7 @@ func networkSetNsAction(iface *net.Interface, rtattr *RtAttr) error {
} }
// Move a particular network interface to a particular network namespace // Move a particular network interface to a particular network namespace
// specified by PID. This is idential to running: ip link set dev $name netns $pid // specified by PID. This is identical to running: ip link set dev $name netns $pid
func NetworkSetNsPid(iface *net.Interface, nspid int) error { func NetworkSetNsPid(iface *net.Interface, nspid int) error {
data := uint32Attr(syscall.IFLA_NET_NS_PID, uint32(nspid)) data := uint32Attr(syscall.IFLA_NET_NS_PID, uint32(nspid))
return networkSetNsAction(iface, data) return networkSetNsAction(iface, data)
@ -673,7 +673,7 @@ func NetworkSetNsFd(iface *net.Interface, fd int) error {
return networkSetNsAction(iface, data) return networkSetNsAction(iface, data)
} }
// Rname a particular interface to a different name // Rename a particular interface to a different name
// !!! Note that you can't rename an active interface. You need to bring it down before renaming it. // !!! Note that you can't rename an active interface. You need to bring it down before renaming it.
// This is identical to running: ip link set dev ${oldName} name ${newName} // This is identical to running: ip link set dev ${oldName} name ${newName}
func NetworkChangeName(iface *net.Interface, newName string) error { func NetworkChangeName(iface *net.Interface, newName string) error {