Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
| ... | ... |
@@ -75,7 +75,7 @@ rm -rf src/github.com/docker/distribution |
| 75 | 75 |
mkdir -p src/github.com/docker/distribution |
| 76 | 76 |
mv tmp-digest src/github.com/docker/distribution/digest |
| 77 | 77 |
|
| 78 |
-clone git github.com/docker/libcontainer 4a72e540feb67091156b907c4700e580a99f5a9d |
|
| 78 |
+clone git github.com/docker/libcontainer fd0087d3acdc4c5865de1829d4accee5e3ebb658 |
|
| 79 | 79 |
# see src/github.com/docker/libcontainer/update-vendor.sh which is the "source of truth" for libcontainer deps (just like this file) |
| 80 | 80 |
rm -rf src/github.com/docker/libcontainer/vendor |
| 81 | 81 |
eval "$(grep '^clone ' src/github.com/docker/libcontainer/update-vendor.sh | grep -v 'github.com/codegangsta/cli' | grep -v 'github.com/Sirupsen/logrus')" |
| ... | ... |
@@ -99,12 +99,11 @@ func (m *Manager) Apply(pid int) error {
|
| 99 | 99 |
// created then join consists of writing the process pids to cgroup.procs |
| 100 | 100 |
p, err := d.path(name) |
| 101 | 101 |
if err != nil {
|
| 102 |
+ if cgroups.IsNotFound(err) {
|
|
| 103 |
+ continue |
|
| 104 |
+ } |
|
| 102 | 105 |
return err |
| 103 | 106 |
} |
| 104 |
- if !cgroups.PathExists(p) {
|
|
| 105 |
- continue |
|
| 106 |
- } |
|
| 107 |
- |
|
| 108 | 107 |
paths[name] = p |
| 109 | 108 |
} |
| 110 | 109 |
m.Paths = paths |
| ... | ... |
@@ -17,12 +17,8 @@ type BlkioGroup struct {
|
| 17 | 17 |
|
| 18 | 18 |
func (s *BlkioGroup) Apply(d *data) error {
|
| 19 | 19 |
dir, err := d.join("blkio")
|
| 20 |
- if err != nil {
|
|
| 21 |
- if cgroups.IsNotFound(err) {
|
|
| 22 |
- return nil |
|
| 23 |
- } else {
|
|
| 24 |
- return err |
|
| 25 |
- } |
|
| 20 |
+ if err != nil && !cgroups.IsNotFound(err) {
|
|
| 21 |
+ return err |
|
| 26 | 22 |
} |
| 27 | 23 |
|
| 28 | 24 |
if err := s.Set(dir, d.c); err != nil {
|
| ... | ... |
@@ -18,11 +18,7 @@ func (s *CpuGroup) Apply(d *data) error {
|
| 18 | 18 |
// on a container basis |
| 19 | 19 |
dir, err := d.join("cpu")
|
| 20 | 20 |
if err != nil {
|
| 21 |
- if cgroups.IsNotFound(err) {
|
|
| 22 |
- return nil |
|
| 23 |
- } else {
|
|
| 24 |
- return err |
|
| 25 |
- } |
|
| 21 |
+ return err |
|
| 26 | 22 |
} |
| 27 | 23 |
|
| 28 | 24 |
if err := s.Set(dir, d.c); err != nil {
|
| ... | ... |
@@ -11,11 +11,7 @@ type DevicesGroup struct {
|
| 11 | 11 |
func (s *DevicesGroup) Apply(d *data) error {
|
| 12 | 12 |
dir, err := d.join("devices")
|
| 13 | 13 |
if err != nil {
|
| 14 |
- if cgroups.IsNotFound(err) {
|
|
| 15 |
- return nil |
|
| 16 |
- } else {
|
|
| 17 |
- return err |
|
| 18 |
- } |
|
| 14 |
+ return err |
|
| 19 | 15 |
} |
| 20 | 16 |
|
| 21 | 17 |
if err := s.Set(dir, d.c); err != nil {
|
| ... | ... |
@@ -13,12 +13,8 @@ type FreezerGroup struct {
|
| 13 | 13 |
|
| 14 | 14 |
func (s *FreezerGroup) Apply(d *data) error {
|
| 15 | 15 |
dir, err := d.join("freezer")
|
| 16 |
- if err != nil {
|
|
| 17 |
- if cgroups.IsNotFound(err) {
|
|
| 18 |
- return nil |
|
| 19 |
- } else {
|
|
| 20 |
- return err |
|
| 21 |
- } |
|
| 16 |
+ if err != nil && !cgroups.IsNotFound(err) {
|
|
| 17 |
+ return err |
|
| 22 | 18 |
} |
| 23 | 19 |
|
| 24 | 20 |
if err := s.Set(dir, d.c); err != nil {
|
| ... | ... |
@@ -16,12 +16,9 @@ type MemoryGroup struct {
|
| 16 | 16 |
|
| 17 | 17 |
func (s *MemoryGroup) Apply(d *data) error {
|
| 18 | 18 |
dir, err := d.join("memory")
|
| 19 |
- if err != nil {
|
|
| 20 |
- if cgroups.IsNotFound(err) {
|
|
| 21 |
- return nil |
|
| 22 |
- } else {
|
|
| 23 |
- return err |
|
| 24 |
- } |
|
| 19 |
+ // only return an error for memory if it was specified |
|
| 20 |
+ if err != nil && (d.c.Memory != 0 || d.c.MemoryReservation != 0 || d.c.MemorySwap != 0) {
|
|
| 21 |
+ return err |
|
| 25 | 22 |
} |
| 26 | 23 |
defer func() {
|
| 27 | 24 |
if err != nil {
|
| ... | ... |
@@ -91,7 +91,7 @@ func UseSystemd() bool {
|
| 91 | 91 |
ddf := newProp("DefaultDependencies", false)
|
| 92 | 92 |
if _, err := theConn.StartTransientUnit("docker-systemd-test-default-dependencies.scope", "replace", ddf); err != nil {
|
| 93 | 93 |
if dbusError, ok := err.(dbus.Error); ok {
|
| 94 |
- if dbusError.Name == "org.freedesktop.DBus.Error.PropertyReadOnly" {
|
|
| 94 |
+ if strings.Contains(dbusError.Name, "org.freedesktop.DBus.Error.PropertyReadOnly") {
|
|
| 95 | 95 |
hasTransientDefaultDependencies = false |
| 96 | 96 |
} |
| 97 | 97 |
} |
| ... | ... |
@@ -659,7 +659,7 @@ func networkSetNsAction(iface *net.Interface, rtattr *RtAttr) error {
|
| 659 | 659 |
} |
| 660 | 660 |
|
| 661 | 661 |
// Move a particular network interface to a particular network namespace |
| 662 |
-// specified by PID. This is idential to running: ip link set dev $name netns $pid |
|
| 662 |
+// specified by PID. This is identical to running: ip link set dev $name netns $pid |
|
| 663 | 663 |
func NetworkSetNsPid(iface *net.Interface, nspid int) error {
|
| 664 | 664 |
data := uint32Attr(syscall.IFLA_NET_NS_PID, uint32(nspid)) |
| 665 | 665 |
return networkSetNsAction(iface, data) |
| ... | ... |
@@ -673,7 +673,7 @@ func NetworkSetNsFd(iface *net.Interface, fd int) error {
|
| 673 | 673 |
return networkSetNsAction(iface, data) |
| 674 | 674 |
} |
| 675 | 675 |
|
| 676 |
-// Rname a particular interface to a different name |
|
| 676 |
+// Rename a particular interface to a different name |
|
| 677 | 677 |
// !!! Note that you can't rename an active interface. You need to bring it down before renaming it. |
| 678 | 678 |
// This is identical to running: ip link set dev ${oldName} name ${newName}
|
| 679 | 679 |
func NetworkChangeName(iface *net.Interface, newName string) error {
|