فهرست منبع

Merge pull request #20774 from hqhq/hq_vender_engine_api

Vendor engine-api to 70d266e96080e3c3d63c55a4d8659e00ac1f7e6c
Sebastiaan van Stijn 9 سال پیش
والد
کامیت
b211e57f23
35فایلهای تغییر یافته به همراه347 افزوده شده و 326 حذف شده
  1. 8 8
      builder/dockerfile/dispatchers.go
  2. 10 10
      builder/dockerfile/internals.go
  3. 3 3
      daemon/commit.go
  4. 2 2
      daemon/container_operations_unix.go
  5. 5 7
      daemon/daemon.go
  6. 2 2
      daemon/exec.go
  7. 1 1
      hack/vendor.sh
  8. 1 1
      image/v1/imagev1.go
  9. 2 2
      integration-cli/docker_api_containers_test.go
  10. 9 9
      integration-cli/docker_cli_build_test.go
  11. 2 2
      integration-cli/docker_cli_commit_test.go
  12. 6 10
      runconfig/compare.go
  13. 6 6
      runconfig/compare_test.go
  14. 6 6
      runconfig/config_test.go
  15. 2 2
      runconfig/hostconfig_test.go
  16. 6 6
      runconfig/opts/parse.go
  17. 1 1
      runconfig/opts/parse_test.go
  18. 0 86
      vendor/src/github.com/docker/engine-api/client/network.go
  19. 17 0
      vendor/src/github.com/docker/engine-api/client/network_connect.go
  20. 20 0
      vendor/src/github.com/docker/engine-api/client/network_create.go
  21. 13 0
      vendor/src/github.com/docker/engine-api/client/network_disconnect.go
  22. 23 0
      vendor/src/github.com/docker/engine-api/client/network_inspect.go
  23. 30 0
      vendor/src/github.com/docker/engine-api/client/network_list.go
  24. 8 0
      vendor/src/github.com/docker/engine-api/client/network_remove.go
  25. 0 66
      vendor/src/github.com/docker/engine-api/client/volume.go
  26. 19 0
      vendor/src/github.com/docker/engine-api/client/volume_create.go
  27. 23 0
      vendor/src/github.com/docker/engine-api/client/volume_inspect.go
  28. 31 0
      vendor/src/github.com/docker/engine-api/client/volume_list.go
  29. 8 0
      vendor/src/github.com/docker/engine-api/client/volume_remove.go
  30. 9 4
      vendor/src/github.com/docker/engine-api/types/auth.go
  31. 2 2
      vendor/src/github.com/docker/engine-api/types/container/config.go
  32. 18 18
      vendor/src/github.com/docker/engine-api/types/container/host_config.go
  33. 45 23
      vendor/src/github.com/docker/engine-api/types/container/hostconfig_windows.go
  34. 8 49
      vendor/src/github.com/docker/engine-api/types/strslice/strslice.go
  35. 1 0
      vendor/src/github.com/docker/engine-api/types/types.go

+ 8 - 8
builder/dockerfile/dispatchers.go

@@ -310,20 +310,20 @@ func run(b *Builder, args []string, attributes map[string]bool, original string)
 	}
 	}
 
 
 	config := &container.Config{
 	config := &container.Config{
-		Cmd:   strslice.New(args...),
+		Cmd:   strslice.StrSlice(args),
 		Image: b.image,
 		Image: b.image,
 	}
 	}
 
 
 	// stash the cmd
 	// stash the cmd
 	cmd := b.runConfig.Cmd
 	cmd := b.runConfig.Cmd
-	if b.runConfig.Entrypoint.Len() == 0 && b.runConfig.Cmd.Len() == 0 {
+	if len(b.runConfig.Entrypoint) == 0 && len(b.runConfig.Cmd) == 0 {
 		b.runConfig.Cmd = config.Cmd
 		b.runConfig.Cmd = config.Cmd
 	}
 	}
 
 
 	// stash the config environment
 	// stash the config environment
 	env := b.runConfig.Env
 	env := b.runConfig.Env
 
 
-	defer func(cmd *strslice.StrSlice) { b.runConfig.Cmd = cmd }(cmd)
+	defer func(cmd strslice.StrSlice) { b.runConfig.Cmd = cmd }(cmd)
 	defer func(env []string) { b.runConfig.Env = env }(env)
 	defer func(env []string) { b.runConfig.Env = env }(env)
 
 
 	// derive the net build-time environment for this run. We let config
 	// derive the net build-time environment for this run. We let config
@@ -366,7 +366,7 @@ func run(b *Builder, args []string, attributes map[string]bool, original string)
 	if len(cmdBuildEnv) > 0 {
 	if len(cmdBuildEnv) > 0 {
 		sort.Strings(cmdBuildEnv)
 		sort.Strings(cmdBuildEnv)
 		tmpEnv := append([]string{fmt.Sprintf("|%d", len(cmdBuildEnv))}, cmdBuildEnv...)
 		tmpEnv := append([]string{fmt.Sprintf("|%d", len(cmdBuildEnv))}, cmdBuildEnv...)
-		saveCmd = strslice.New(append(tmpEnv, saveCmd.Slice()...)...)
+		saveCmd = strslice.StrSlice(append(tmpEnv, saveCmd...))
 	}
 	}
 
 
 	b.runConfig.Cmd = saveCmd
 	b.runConfig.Cmd = saveCmd
@@ -424,7 +424,7 @@ func cmd(b *Builder, args []string, attributes map[string]bool, original string)
 		}
 		}
 	}
 	}
 
 
-	b.runConfig.Cmd = strslice.New(cmdSlice...)
+	b.runConfig.Cmd = strslice.StrSlice(cmdSlice)
 
 
 	if err := b.commit("", b.runConfig.Cmd, fmt.Sprintf("CMD %q", cmdSlice)); err != nil {
 	if err := b.commit("", b.runConfig.Cmd, fmt.Sprintf("CMD %q", cmdSlice)); err != nil {
 		return err
 		return err
@@ -455,16 +455,16 @@ func entrypoint(b *Builder, args []string, attributes map[string]bool, original
 	switch {
 	switch {
 	case attributes["json"]:
 	case attributes["json"]:
 		// ENTRYPOINT ["echo", "hi"]
 		// ENTRYPOINT ["echo", "hi"]
-		b.runConfig.Entrypoint = strslice.New(parsed...)
+		b.runConfig.Entrypoint = strslice.StrSlice(parsed)
 	case len(parsed) == 0:
 	case len(parsed) == 0:
 		// ENTRYPOINT []
 		// ENTRYPOINT []
 		b.runConfig.Entrypoint = nil
 		b.runConfig.Entrypoint = nil
 	default:
 	default:
 		// ENTRYPOINT echo hi
 		// ENTRYPOINT echo hi
 		if runtime.GOOS != "windows" {
 		if runtime.GOOS != "windows" {
-			b.runConfig.Entrypoint = strslice.New("/bin/sh", "-c", parsed[0])
+			b.runConfig.Entrypoint = strslice.StrSlice{"/bin/sh", "-c", parsed[0]}
 		} else {
 		} else {
-			b.runConfig.Entrypoint = strslice.New("cmd", "/S", "/C", parsed[0])
+			b.runConfig.Entrypoint = strslice.StrSlice{"cmd", "/S", "/C", parsed[0]}
 		}
 		}
 	}
 	}
 
 

+ 10 - 10
builder/dockerfile/internals.go

@@ -37,7 +37,7 @@ import (
 	"github.com/docker/engine-api/types/strslice"
 	"github.com/docker/engine-api/types/strslice"
 )
 )
 
 
-func (b *Builder) commit(id string, autoCmd *strslice.StrSlice, comment string) error {
+func (b *Builder) commit(id string, autoCmd strslice.StrSlice, comment string) error {
 	if b.disableCommit {
 	if b.disableCommit {
 		return nil
 		return nil
 	}
 	}
@@ -48,11 +48,11 @@ func (b *Builder) commit(id string, autoCmd *strslice.StrSlice, comment string)
 	if id == "" {
 	if id == "" {
 		cmd := b.runConfig.Cmd
 		cmd := b.runConfig.Cmd
 		if runtime.GOOS != "windows" {
 		if runtime.GOOS != "windows" {
-			b.runConfig.Cmd = strslice.New("/bin/sh", "-c", "#(nop) "+comment)
+			b.runConfig.Cmd = strslice.StrSlice{"/bin/sh", "-c", "#(nop) " + comment}
 		} else {
 		} else {
-			b.runConfig.Cmd = strslice.New("cmd", "/S /C", "REM (nop) "+comment)
+			b.runConfig.Cmd = strslice.StrSlice{"cmd", "/S /C", "REM (nop) " + comment}
 		}
 		}
-		defer func(cmd *strslice.StrSlice) { b.runConfig.Cmd = cmd }(cmd)
+		defer func(cmd strslice.StrSlice) { b.runConfig.Cmd = cmd }(cmd)
 
 
 		hit, err := b.probeCache()
 		hit, err := b.probeCache()
 		if err != nil {
 		if err != nil {
@@ -171,11 +171,11 @@ func (b *Builder) runContextCommand(args []string, allowRemote bool, allowLocalD
 
 
 	cmd := b.runConfig.Cmd
 	cmd := b.runConfig.Cmd
 	if runtime.GOOS != "windows" {
 	if runtime.GOOS != "windows" {
-		b.runConfig.Cmd = strslice.New("/bin/sh", "-c", fmt.Sprintf("#(nop) %s %s in %s", cmdName, srcHash, dest))
+		b.runConfig.Cmd = strslice.StrSlice{"/bin/sh", "-c", fmt.Sprintf("#(nop) %s %s in %s", cmdName, srcHash, dest)}
 	} else {
 	} else {
-		b.runConfig.Cmd = strslice.New("cmd", "/S", "/C", fmt.Sprintf("REM (nop) %s %s in %s", cmdName, srcHash, dest))
+		b.runConfig.Cmd = strslice.StrSlice{"cmd", "/S", "/C", fmt.Sprintf("REM (nop) %s %s in %s", cmdName, srcHash, dest)}
 	}
 	}
-	defer func(cmd *strslice.StrSlice) { b.runConfig.Cmd = cmd }(cmd)
+	defer func(cmd strslice.StrSlice) { b.runConfig.Cmd = cmd }(cmd)
 
 
 	if hit, err := b.probeCache(); err != nil {
 	if hit, err := b.probeCache(); err != nil {
 		return err
 		return err
@@ -527,9 +527,9 @@ func (b *Builder) create() (string, error) {
 	b.tmpContainers[c.ID] = struct{}{}
 	b.tmpContainers[c.ID] = struct{}{}
 	fmt.Fprintf(b.Stdout, " ---> Running in %s\n", stringid.TruncateID(c.ID))
 	fmt.Fprintf(b.Stdout, " ---> Running in %s\n", stringid.TruncateID(c.ID))
 
 
-	if config.Cmd.Len() > 0 {
+	if len(config.Cmd) > 0 {
 		// override the entry point that may have been picked up from the base image
 		// override the entry point that may have been picked up from the base image
-		if err := b.docker.ContainerUpdateCmdOnBuild(c.ID, config.Cmd.Slice()); err != nil {
+		if err := b.docker.ContainerUpdateCmdOnBuild(c.ID, config.Cmd); err != nil {
 			return "", err
 			return "", err
 		}
 		}
 	}
 	}
@@ -567,7 +567,7 @@ func (b *Builder) run(cID string) (err error) {
 	if ret, _ := b.docker.ContainerWait(cID, -1); ret != 0 {
 	if ret, _ := b.docker.ContainerWait(cID, -1); ret != 0 {
 		// TODO: change error type, because jsonmessage.JSONError assumes HTTP
 		// TODO: change error type, because jsonmessage.JSONError assumes HTTP
 		return &jsonmessage.JSONError{
 		return &jsonmessage.JSONError{
-			Message: fmt.Sprintf("The command '%s' returned a non-zero code: %d", b.runConfig.Cmd.ToString(), ret),
+			Message: fmt.Sprintf("The command '%s' returned a non-zero code: %d", strings.Join(b.runConfig.Cmd, " "), ret),
 			Code:    ret,
 			Code:    ret,
 		}
 		}
 	}
 	}

+ 3 - 3
daemon/commit.go

@@ -70,8 +70,8 @@ func merge(userConf, imageConf *containertypes.Config) error {
 		userConf.Labels = imageConf.Labels
 		userConf.Labels = imageConf.Labels
 	}
 	}
 
 
-	if userConf.Entrypoint.Len() == 0 {
-		if userConf.Cmd.Len() == 0 {
+	if len(userConf.Entrypoint) == 0 {
+		if len(userConf.Cmd) == 0 {
 			userConf.Cmd = imageConf.Cmd
 			userConf.Cmd = imageConf.Cmd
 		}
 		}
 
 
@@ -151,7 +151,7 @@ func (daemon *Daemon) Commit(name string, c *types.ContainerCommitConfig) (strin
 	h := image.History{
 	h := image.History{
 		Author:     c.Author,
 		Author:     c.Author,
 		Created:    time.Now().UTC(),
 		Created:    time.Now().UTC(),
-		CreatedBy:  strings.Join(container.Config.Cmd.Slice(), " "),
+		CreatedBy:  strings.Join(container.Config.Cmd, " "),
 		Comment:    c.Comment,
 		Comment:    c.Comment,
 		EmptyLayer: true,
 		EmptyLayer: true,
 	}
 	}

+ 2 - 2
daemon/container_operations_unix.go

@@ -257,8 +257,8 @@ func (daemon *Daemon) populateCommand(c *container.Container, env []string) erro
 		AllowedDevices:     allowedDevices,
 		AllowedDevices:     allowedDevices,
 		AppArmorProfile:    c.AppArmorProfile,
 		AppArmorProfile:    c.AppArmorProfile,
 		AutoCreatedDevices: autoCreatedDevices,
 		AutoCreatedDevices: autoCreatedDevices,
-		CapAdd:             c.HostConfig.CapAdd.Slice(),
-		CapDrop:            c.HostConfig.CapDrop.Slice(),
+		CapAdd:             c.HostConfig.CapAdd,
+		CapDrop:            c.HostConfig.CapDrop,
 		CgroupParent:       defaultCgroupParent,
 		CgroupParent:       defaultCgroupParent,
 		GIDMapping:         gidMap,
 		GIDMapping:         gidMap,
 		GroupAdd:           c.HostConfig.GroupAdd,
 		GroupAdd:           c.HostConfig.GroupAdd,

+ 5 - 7
daemon/daemon.go

@@ -412,7 +412,7 @@ func (daemon *Daemon) mergeAndVerifyConfig(config *containertypes.Config, img *i
 			return err
 			return err
 		}
 		}
 	}
 	}
-	if config.Entrypoint.Len() == 0 && config.Cmd.Len() == 0 {
+	if len(config.Entrypoint) == 0 && len(config.Cmd) == 0 {
 		return fmt.Errorf("No command specified")
 		return fmt.Errorf("No command specified")
 	}
 	}
 	return nil
 	return nil
@@ -495,13 +495,11 @@ func (daemon *Daemon) generateHostname(id string, config *containertypes.Config)
 	}
 	}
 }
 }
 
 
-func (daemon *Daemon) getEntrypointAndArgs(configEntrypoint *strslice.StrSlice, configCmd *strslice.StrSlice) (string, []string) {
-	cmdSlice := configCmd.Slice()
-	if configEntrypoint.Len() != 0 {
-		eSlice := configEntrypoint.Slice()
-		return eSlice[0], append(eSlice[1:], cmdSlice...)
+func (daemon *Daemon) getEntrypointAndArgs(configEntrypoint strslice.StrSlice, configCmd strslice.StrSlice) (string, []string) {
+	if len(configEntrypoint) != 0 {
+		return configEntrypoint[0], append(configEntrypoint[1:], configCmd...)
 	}
 	}
-	return cmdSlice[0], cmdSlice[1:]
+	return configCmd[0], configCmd[1:]
 }
 }
 
 
 func (daemon *Daemon) newContainer(name string, config *containertypes.Config, imgID image.ID) (*container.Container, error) {
 func (daemon *Daemon) newContainer(name string, config *containertypes.Config, imgID image.ID) (*container.Container, error) {

+ 2 - 2
daemon/exec.go

@@ -93,8 +93,8 @@ func (d *Daemon) ContainerExecCreate(config *types.ExecConfig) (string, error) {
 		return "", err
 		return "", err
 	}
 	}
 
 
-	cmd := strslice.New(config.Cmd...)
-	entrypoint, args := d.getEntrypointAndArgs(strslice.New(), cmd)
+	cmd := strslice.StrSlice(config.Cmd)
+	entrypoint, args := d.getEntrypointAndArgs(strslice.StrSlice{}, cmd)
 
 
 	keys := []byte{}
 	keys := []byte{}
 	if config.DetachKeys != "" {
 	if config.DetachKeys != "" {

+ 1 - 1
hack/vendor.sh

@@ -24,7 +24,7 @@ clone git golang.org/x/net 47990a1ba55743e6ef1affd3a14e5bac8553615d https://gith
 clone git golang.org/x/sys eb2c74142fd19a79b3f237334c7384d5167b1b46 https://github.com/golang/sys.git
 clone git golang.org/x/sys eb2c74142fd19a79b3f237334c7384d5167b1b46 https://github.com/golang/sys.git
 clone git github.com/docker/go-units 651fc226e7441360384da338d0fd37f2440ffbe3
 clone git github.com/docker/go-units 651fc226e7441360384da338d0fd37f2440ffbe3
 clone git github.com/docker/go-connections v0.2.0
 clone git github.com/docker/go-connections v0.2.0
-clone git github.com/docker/engine-api 575694d38967b53e06cafe8b722c72892dd64db0
+clone git github.com/docker/engine-api 70d266e96080e3c3d63c55a4d8659e00ac1f7e6c
 clone git github.com/RackSec/srslog 6eb773f331e46fbba8eecb8e794e635e75fc04de
 clone git github.com/RackSec/srslog 6eb773f331e46fbba8eecb8e794e635e75fc04de
 clone git github.com/imdario/mergo 0.2.1
 clone git github.com/imdario/mergo 0.2.1
 
 

+ 1 - 1
image/v1/imagev1.go

@@ -31,7 +31,7 @@ func HistoryFromConfig(imageJSON []byte, emptyLayer bool) (image.History, error)
 	return image.History{
 	return image.History{
 		Author:     v1Image.Author,
 		Author:     v1Image.Author,
 		Created:    v1Image.Created,
 		Created:    v1Image.Created,
-		CreatedBy:  strings.Join(v1Image.ContainerConfig.Cmd.Slice(), " "),
+		CreatedBy:  strings.Join(v1Image.ContainerConfig.Cmd, " "),
 		Comment:    v1Image.Comment,
 		Comment:    v1Image.Comment,
 		EmptyLayer: emptyLayer,
 		EmptyLayer: emptyLayer,
 	}, nil
 	}, nil

+ 2 - 2
integration-cli/docker_api_containers_test.go

@@ -532,7 +532,7 @@ func (s *DockerSuite) TestContainerApiCommit(c *check.C) {
 	c.Assert(json.Unmarshal(b, &img), checker.IsNil)
 	c.Assert(json.Unmarshal(b, &img), checker.IsNil)
 
 
 	cmd := inspectField(c, img.ID, "Config.Cmd")
 	cmd := inspectField(c, img.ID, "Config.Cmd")
-	c.Assert(cmd, checker.Equals, "{[/bin/sh -c touch /test]}", check.Commentf("got wrong Cmd from commit: %q", cmd))
+	c.Assert(cmd, checker.Equals, "[/bin/sh -c touch /test]", check.Commentf("got wrong Cmd from commit: %q", cmd))
 
 
 	// sanity check, make sure the image is what we think it is
 	// sanity check, make sure the image is what we think it is
 	dockerCmd(c, "run", img.ID, "ls", "/test")
 	dockerCmd(c, "run", img.ID, "ls", "/test")
@@ -564,7 +564,7 @@ func (s *DockerSuite) TestContainerApiCommitWithLabelInConfig(c *check.C) {
 	c.Assert(label2, checker.Equals, "value2")
 	c.Assert(label2, checker.Equals, "value2")
 
 
 	cmd := inspectField(c, img.ID, "Config.Cmd")
 	cmd := inspectField(c, img.ID, "Config.Cmd")
-	c.Assert(cmd, checker.Equals, "{[/bin/sh -c touch /test]}", check.Commentf("got wrong Cmd from commit: %q", cmd))
+	c.Assert(cmd, checker.Equals, "[/bin/sh -c touch /test]", check.Commentf("got wrong Cmd from commit: %q", cmd))
 
 
 	// sanity check, make sure the image is what we think it is
 	// sanity check, make sure the image is what we think it is
 	dockerCmd(c, "run", img.ID, "ls", "/test")
 	dockerCmd(c, "run", img.ID, "ls", "/test")

+ 9 - 9
integration-cli/docker_cli_build_test.go

@@ -2230,7 +2230,7 @@ func (s *DockerSuite) TestBuildContextCleanupFailedBuild(c *check.C) {
 func (s *DockerSuite) TestBuildCmd(c *check.C) {
 func (s *DockerSuite) TestBuildCmd(c *check.C) {
 	name := "testbuildcmd"
 	name := "testbuildcmd"
 
 
-	expected := "{[/bin/echo Hello World]}"
+	expected := "[/bin/echo Hello World]"
 	_, err := buildImage(name,
 	_, err := buildImage(name,
 		`FROM `+minimalBaseImage()+`
 		`FROM `+minimalBaseImage()+`
         CMD ["/bin/echo", "Hello World"]`,
         CMD ["/bin/echo", "Hello World"]`,
@@ -2362,7 +2362,7 @@ func (s *DockerSuite) TestBuildEmptyEntrypointInheritance(c *check.C) {
 	}
 	}
 	res := inspectField(c, name, "Config.Entrypoint")
 	res := inspectField(c, name, "Config.Entrypoint")
 
 
-	expected := "{[/bin/echo]}"
+	expected := "[/bin/echo]"
 	if res != expected {
 	if res != expected {
 		c.Fatalf("Entrypoint %s, expected %s", res, expected)
 		c.Fatalf("Entrypoint %s, expected %s", res, expected)
 	}
 	}
@@ -2376,7 +2376,7 @@ func (s *DockerSuite) TestBuildEmptyEntrypointInheritance(c *check.C) {
 	}
 	}
 	res = inspectField(c, name2, "Config.Entrypoint")
 	res = inspectField(c, name2, "Config.Entrypoint")
 
 
-	expected = "{[]}"
+	expected = "[]"
 
 
 	if res != expected {
 	if res != expected {
 		c.Fatalf("Entrypoint %s, expected %s", res, expected)
 		c.Fatalf("Entrypoint %s, expected %s", res, expected)
@@ -2386,7 +2386,7 @@ func (s *DockerSuite) TestBuildEmptyEntrypointInheritance(c *check.C) {
 
 
 func (s *DockerSuite) TestBuildEmptyEntrypoint(c *check.C) {
 func (s *DockerSuite) TestBuildEmptyEntrypoint(c *check.C) {
 	name := "testbuildentrypoint"
 	name := "testbuildentrypoint"
-	expected := "{[]}"
+	expected := "[]"
 
 
 	_, err := buildImage(name,
 	_, err := buildImage(name,
 		`FROM busybox
 		`FROM busybox
@@ -2405,7 +2405,7 @@ func (s *DockerSuite) TestBuildEmptyEntrypoint(c *check.C) {
 func (s *DockerSuite) TestBuildEntrypoint(c *check.C) {
 func (s *DockerSuite) TestBuildEntrypoint(c *check.C) {
 	name := "testbuildentrypoint"
 	name := "testbuildentrypoint"
 
 
-	expected := "{[/bin/echo]}"
+	expected := "[/bin/echo]"
 	_, err := buildImage(name,
 	_, err := buildImage(name,
 		`FROM `+minimalBaseImage()+`
 		`FROM `+minimalBaseImage()+`
         ENTRYPOINT ["/bin/echo"]`,
         ENTRYPOINT ["/bin/echo"]`,
@@ -3087,7 +3087,7 @@ func (s *DockerSuite) TestBuildEntrypointRunCleanup(c *check.C) {
 	}
 	}
 	res := inspectField(c, name, "Config.Cmd")
 	res := inspectField(c, name, "Config.Cmd")
 	// Cmd must be cleaned up
 	// Cmd must be cleaned up
-	if res != "<nil>" {
+	if res != "[]" {
 		c.Fatalf("Cmd %s, expected nil", res)
 		c.Fatalf("Cmd %s, expected nil", res)
 	}
 	}
 }
 }
@@ -3164,7 +3164,7 @@ func (s *DockerSuite) TestBuildInheritance(c *check.C) {
 	}
 	}
 
 
 	res := inspectField(c, name, "Config.Entrypoint")
 	res := inspectField(c, name, "Config.Entrypoint")
-	if expected := "{[/bin/echo]}"; res != expected {
+	if expected := "[/bin/echo]"; res != expected {
 		c.Fatalf("Entrypoint %s, expected %s", res, expected)
 		c.Fatalf("Entrypoint %s, expected %s", res, expected)
 	}
 	}
 	ports2 := inspectField(c, name, "Config.ExposedPorts")
 	ports2 := inspectField(c, name, "Config.ExposedPorts")
@@ -4367,12 +4367,12 @@ func (s *DockerSuite) TestBuildCleanupCmdOnEntrypoint(c *check.C) {
 		c.Fatal(err)
 		c.Fatal(err)
 	}
 	}
 	res := inspectField(c, name, "Config.Cmd")
 	res := inspectField(c, name, "Config.Cmd")
-	if res != "<nil>" {
+	if res != "[]" {
 		c.Fatalf("Cmd %s, expected nil", res)
 		c.Fatalf("Cmd %s, expected nil", res)
 	}
 	}
 
 
 	res = inspectField(c, name, "Config.Entrypoint")
 	res = inspectField(c, name, "Config.Entrypoint")
-	if expected := "{[cat]}"; res != expected {
+	if expected := "[cat]"; res != expected {
 		c.Fatalf("Entrypoint %s, expected %s", res, expected)
 		c.Fatalf("Entrypoint %s, expected %s", res, expected)
 	}
 	}
 }
 }

+ 2 - 2
integration-cli/docker_cli_commit_test.go

@@ -129,9 +129,9 @@ func (s *DockerSuite) TestCommitChange(c *check.C) {
 		"Config.ExposedPorts": "map[8080/tcp:{}]",
 		"Config.ExposedPorts": "map[8080/tcp:{}]",
 		"Config.Env":          "[DEBUG=true test=1 PATH=/foo]",
 		"Config.Env":          "[DEBUG=true test=1 PATH=/foo]",
 		"Config.Labels":       "map[foo:bar]",
 		"Config.Labels":       "map[foo:bar]",
-		"Config.Cmd":          "{[/bin/sh]}",
+		"Config.Cmd":          "[/bin/sh]",
 		"Config.WorkingDir":   "/opt",
 		"Config.WorkingDir":   "/opt",
-		"Config.Entrypoint":   "{[/bin/sh]}",
+		"Config.Entrypoint":   "[/bin/sh]",
 		"Config.User":         "testuser",
 		"Config.User":         "testuser",
 		"Config.Volumes":      "map[/var/lib/docker:{}]",
 		"Config.Volumes":      "map[/var/lib/docker:{}]",
 		"Config.OnBuild":      "[/usr/local/bin/python-build --dir /app/src]",
 		"Config.OnBuild":      "[/usr/local/bin/python-build --dir /app/src]",

+ 6 - 10
runconfig/compare.go

@@ -17,19 +17,17 @@ func Compare(a, b *container.Config) bool {
 		return false
 		return false
 	}
 	}
 
 
-	if a.Cmd.Len() != b.Cmd.Len() ||
+	if len(a.Cmd) != len(b.Cmd) ||
 		len(a.Env) != len(b.Env) ||
 		len(a.Env) != len(b.Env) ||
 		len(a.Labels) != len(b.Labels) ||
 		len(a.Labels) != len(b.Labels) ||
 		len(a.ExposedPorts) != len(b.ExposedPorts) ||
 		len(a.ExposedPorts) != len(b.ExposedPorts) ||
-		a.Entrypoint.Len() != b.Entrypoint.Len() ||
+		len(a.Entrypoint) != len(b.Entrypoint) ||
 		len(a.Volumes) != len(b.Volumes) {
 		len(a.Volumes) != len(b.Volumes) {
 		return false
 		return false
 	}
 	}
 
 
-	aCmd := a.Cmd.Slice()
-	bCmd := b.Cmd.Slice()
-	for i := 0; i < len(aCmd); i++ {
-		if aCmd[i] != bCmd[i] {
+	for i := 0; i < len(a.Cmd); i++ {
+		if a.Cmd[i] != b.Cmd[i] {
 			return false
 			return false
 		}
 		}
 	}
 	}
@@ -49,10 +47,8 @@ func Compare(a, b *container.Config) bool {
 		}
 		}
 	}
 	}
 
 
-	aEntrypoint := a.Entrypoint.Slice()
-	bEntrypoint := b.Entrypoint.Slice()
-	for i := 0; i < len(aEntrypoint); i++ {
-		if aEntrypoint[i] != bEntrypoint[i] {
+	for i := 0; i < len(a.Entrypoint); i++ {
+		if a.Entrypoint[i] != b.Entrypoint[i] {
 			return false
 			return false
 		}
 		}
 	}
 	}

+ 6 - 6
runconfig/compare_test.go

@@ -34,12 +34,12 @@ func TestCompare(t *testing.T) {
 	volumes3["/test3"] = struct{}{}
 	volumes3["/test3"] = struct{}{}
 	envs1 := []string{"ENV1=value1", "ENV2=value2"}
 	envs1 := []string{"ENV1=value1", "ENV2=value2"}
 	envs2 := []string{"ENV1=value1", "ENV3=value3"}
 	envs2 := []string{"ENV1=value1", "ENV3=value3"}
-	entrypoint1 := strslice.New("/bin/sh", "-c")
-	entrypoint2 := strslice.New("/bin/sh", "-d")
-	entrypoint3 := strslice.New("/bin/sh", "-c", "echo")
-	cmd1 := strslice.New("/bin/sh", "-c")
-	cmd2 := strslice.New("/bin/sh", "-d")
-	cmd3 := strslice.New("/bin/sh", "-c", "echo")
+	entrypoint1 := strslice.StrSlice{"/bin/sh", "-c"}
+	entrypoint2 := strslice.StrSlice{"/bin/sh", "-d"}
+	entrypoint3 := strslice.StrSlice{"/bin/sh", "-c", "echo"}
+	cmd1 := strslice.StrSlice{"/bin/sh", "-c"}
+	cmd2 := strslice.StrSlice{"/bin/sh", "-d"}
+	cmd3 := strslice.StrSlice{"/bin/sh", "-c", "echo"}
 	labels1 := map[string]string{"LABEL1": "value1", "LABEL2": "value2"}
 	labels1 := map[string]string{"LABEL1": "value1", "LABEL2": "value2"}
 	labels2 := map[string]string{"LABEL1": "value1", "LABEL2": "value3"}
 	labels2 := map[string]string{"LABEL1": "value1", "LABEL2": "value3"}
 	labels3 := map[string]string{"LABEL1": "value1", "LABEL2": "value2", "LABEL3": "value3"}
 	labels3 := map[string]string{"LABEL1": "value1", "LABEL2": "value2", "LABEL3": "value3"}

+ 6 - 6
runconfig/config_test.go

@@ -16,7 +16,7 @@ import (
 
 
 type f struct {
 type f struct {
 	file       string
 	file       string
-	entrypoint *strslice.StrSlice
+	entrypoint strslice.StrSlice
 }
 }
 
 
 func TestDecodeContainerConfig(t *testing.T) {
 func TestDecodeContainerConfig(t *testing.T) {
@@ -29,14 +29,14 @@ func TestDecodeContainerConfig(t *testing.T) {
 	if runtime.GOOS != "windows" {
 	if runtime.GOOS != "windows" {
 		image = "ubuntu"
 		image = "ubuntu"
 		fixtures = []f{
 		fixtures = []f{
-			{"fixtures/unix/container_config_1_14.json", strslice.New()},
-			{"fixtures/unix/container_config_1_17.json", strslice.New("bash")},
-			{"fixtures/unix/container_config_1_19.json", strslice.New("bash")},
+			{"fixtures/unix/container_config_1_14.json", strslice.StrSlice{}},
+			{"fixtures/unix/container_config_1_17.json", strslice.StrSlice{"bash"}},
+			{"fixtures/unix/container_config_1_19.json", strslice.StrSlice{"bash"}},
 		}
 		}
 	} else {
 	} else {
 		image = "windows"
 		image = "windows"
 		fixtures = []f{
 		fixtures = []f{
-			{"fixtures/windows/container_config_1_19.json", strslice.New("cmd")},
+			{"fixtures/windows/container_config_1_19.json", strslice.StrSlice{"cmd"}},
 		}
 		}
 	}
 	}
 
 
@@ -55,7 +55,7 @@ func TestDecodeContainerConfig(t *testing.T) {
 			t.Fatalf("Expected %s image, found %s\n", image, c.Image)
 			t.Fatalf("Expected %s image, found %s\n", image, c.Image)
 		}
 		}
 
 
-		if c.Entrypoint.Len() != f.entrypoint.Len() {
+		if len(c.Entrypoint) != len(f.entrypoint) {
 			t.Fatalf("Expected %v, found %v\n", f.entrypoint, c.Entrypoint)
 			t.Fatalf("Expected %v, found %v\n", f.entrypoint, c.Entrypoint)
 		}
 		}
 
 

+ 2 - 2
runconfig/hostconfig_test.go

@@ -190,11 +190,11 @@ func TestDecodeHostConfig(t *testing.T) {
 			t.Fatalf("Expected 1 bind, found %d\n", l)
 			t.Fatalf("Expected 1 bind, found %d\n", l)
 		}
 		}
 
 
-		if c.CapAdd.Len() != 1 && c.CapAdd.Slice()[0] != "NET_ADMIN" {
+		if len(c.CapAdd) != 1 && c.CapAdd[0] != "NET_ADMIN" {
 			t.Fatalf("Expected CapAdd NET_ADMIN, got %v", c.CapAdd)
 			t.Fatalf("Expected CapAdd NET_ADMIN, got %v", c.CapAdd)
 		}
 		}
 
 
-		if c.CapDrop.Len() != 1 && c.CapDrop.Slice()[0] != "NET_ADMIN" {
+		if len(c.CapDrop) != 1 && c.CapDrop[0] != "NET_ADMIN" {
 			t.Fatalf("Expected CapDrop MKNOD, got %v", c.CapDrop)
 			t.Fatalf("Expected CapDrop MKNOD, got %v", c.CapDrop)
 		}
 		}
 	}
 	}

+ 6 - 6
runconfig/opts/parse.go

@@ -228,15 +228,15 @@ func Parse(cmd *flag.FlagSet, args []string) (*container.Config, *container.Host
 
 
 	var (
 	var (
 		parsedArgs = cmd.Args()
 		parsedArgs = cmd.Args()
-		runCmd     *strslice.StrSlice
-		entrypoint *strslice.StrSlice
+		runCmd     strslice.StrSlice
+		entrypoint strslice.StrSlice
 		image      = cmd.Arg(0)
 		image      = cmd.Arg(0)
 	)
 	)
 	if len(parsedArgs) > 1 {
 	if len(parsedArgs) > 1 {
-		runCmd = strslice.New(parsedArgs[1:]...)
+		runCmd = strslice.StrSlice(parsedArgs[1:])
 	}
 	}
 	if *flEntrypoint != "" {
 	if *flEntrypoint != "" {
-		entrypoint = strslice.New(*flEntrypoint)
+		entrypoint = strslice.StrSlice{*flEntrypoint}
 	}
 	}
 
 
 	var (
 	var (
@@ -402,8 +402,8 @@ func Parse(cmd *flag.FlagSet, args []string) (*container.Config, *container.Host
 		IpcMode:        ipcMode,
 		IpcMode:        ipcMode,
 		PidMode:        pidMode,
 		PidMode:        pidMode,
 		UTSMode:        utsMode,
 		UTSMode:        utsMode,
-		CapAdd:         strslice.New(flCapAdd.GetAll()...),
-		CapDrop:        strslice.New(flCapDrop.GetAll()...),
+		CapAdd:         strslice.StrSlice(flCapAdd.GetAll()),
+		CapDrop:        strslice.StrSlice(flCapDrop.GetAll()),
 		GroupAdd:       flGroupAdd.GetAll(),
 		GroupAdd:       flGroupAdd.GetAll(),
 		RestartPolicy:  restartPolicy,
 		RestartPolicy:  restartPolicy,
 		SecurityOpt:    securityOpts,
 		SecurityOpt:    securityOpts,

+ 1 - 1
runconfig/opts/parse_test.go

@@ -648,7 +648,7 @@ func TestParseEntryPoint(t *testing.T) {
 	if err != nil {
 	if err != nil {
 		t.Fatal(err)
 		t.Fatal(err)
 	}
 	}
-	if config.Entrypoint.Len() != 1 && config.Entrypoint.Slice()[0] != "anything" {
+	if len(config.Entrypoint) != 1 && config.Entrypoint[0] != "anything" {
 		t.Fatalf("Expected entrypoint 'anything', got %v", config.Entrypoint)
 		t.Fatalf("Expected entrypoint 'anything', got %v", config.Entrypoint)
 	}
 	}
 }
 }

+ 0 - 86
vendor/src/github.com/docker/engine-api/client/network.go

@@ -1,86 +0,0 @@
-package client
-
-import (
-	"encoding/json"
-	"net/http"
-	"net/url"
-
-	"github.com/docker/engine-api/types"
-	"github.com/docker/engine-api/types/filters"
-	"github.com/docker/engine-api/types/network"
-)
-
-// NetworkCreate creates a new network in the docker host.
-func (cli *Client) NetworkCreate(options types.NetworkCreate) (types.NetworkCreateResponse, error) {
-	var response types.NetworkCreateResponse
-	serverResp, err := cli.post("/networks/create", nil, options, nil)
-	if err != nil {
-		return response, err
-	}
-
-	json.NewDecoder(serverResp.body).Decode(&response)
-	ensureReaderClosed(serverResp)
-	return response, err
-}
-
-// NetworkRemove removes an existent network from the docker host.
-func (cli *Client) NetworkRemove(networkID string) error {
-	resp, err := cli.delete("/networks/"+networkID, nil, nil)
-	ensureReaderClosed(resp)
-	return err
-}
-
-// NetworkConnect connects a container to an existent network in the docker host.
-func (cli *Client) NetworkConnect(networkID, containerID string, config *network.EndpointSettings) error {
-	nc := types.NetworkConnect{
-		Container:      containerID,
-		EndpointConfig: config,
-	}
-	resp, err := cli.post("/networks/"+networkID+"/connect", nil, nc, nil)
-	ensureReaderClosed(resp)
-	return err
-}
-
-// NetworkDisconnect disconnects a container from an existent network in the docker host.
-func (cli *Client) NetworkDisconnect(networkID, containerID string, force bool) error {
-	nd := types.NetworkDisconnect{Container: containerID, Force: force}
-	resp, err := cli.post("/networks/"+networkID+"/disconnect", nil, nd, nil)
-	ensureReaderClosed(resp)
-	return err
-}
-
-// NetworkList returns the list of networks configured in the docker host.
-func (cli *Client) NetworkList(options types.NetworkListOptions) ([]types.NetworkResource, error) {
-	query := url.Values{}
-	if options.Filters.Len() > 0 {
-		filterJSON, err := filters.ToParam(options.Filters)
-		if err != nil {
-			return nil, err
-		}
-
-		query.Set("filters", filterJSON)
-	}
-	var networkResources []types.NetworkResource
-	resp, err := cli.get("/networks", query, nil)
-	if err != nil {
-		return networkResources, err
-	}
-	err = json.NewDecoder(resp.body).Decode(&networkResources)
-	ensureReaderClosed(resp)
-	return networkResources, err
-}
-
-// NetworkInspect returns the information for a specific network configured in the docker host.
-func (cli *Client) NetworkInspect(networkID string) (types.NetworkResource, error) {
-	var networkResource types.NetworkResource
-	resp, err := cli.get("/networks/"+networkID, nil, nil)
-	if err != nil {
-		if resp.statusCode == http.StatusNotFound {
-			return networkResource, networkNotFoundError{networkID}
-		}
-		return networkResource, err
-	}
-	err = json.NewDecoder(resp.body).Decode(&networkResource)
-	ensureReaderClosed(resp)
-	return networkResource, err
-}

+ 17 - 0
vendor/src/github.com/docker/engine-api/client/network_connect.go

@@ -0,0 +1,17 @@
+package client
+
+import (
+	"github.com/docker/engine-api/types"
+	"github.com/docker/engine-api/types/network"
+)
+
+// NetworkConnect connects a container to an existent network in the docker host.
+func (cli *Client) NetworkConnect(networkID, containerID string, config *network.EndpointSettings) error {
+	nc := types.NetworkConnect{
+		Container:      containerID,
+		EndpointConfig: config,
+	}
+	resp, err := cli.post("/networks/"+networkID+"/connect", nil, nc, nil)
+	ensureReaderClosed(resp)
+	return err
+}

+ 20 - 0
vendor/src/github.com/docker/engine-api/client/network_create.go

@@ -0,0 +1,20 @@
+package client
+
+import (
+	"encoding/json"
+
+	"github.com/docker/engine-api/types"
+)
+
+// NetworkCreate creates a new network in the docker host.
+func (cli *Client) NetworkCreate(options types.NetworkCreate) (types.NetworkCreateResponse, error) {
+	var response types.NetworkCreateResponse
+	serverResp, err := cli.post("/networks/create", nil, options, nil)
+	if err != nil {
+		return response, err
+	}
+
+	json.NewDecoder(serverResp.body).Decode(&response)
+	ensureReaderClosed(serverResp)
+	return response, err
+}

+ 13 - 0
vendor/src/github.com/docker/engine-api/client/network_disconnect.go

@@ -0,0 +1,13 @@
+package client
+
+import (
+	"github.com/docker/engine-api/types"
+)
+
+// NetworkDisconnect disconnects a container from an existent network in the docker host.
+func (cli *Client) NetworkDisconnect(networkID, containerID string, force bool) error {
+	nd := types.NetworkDisconnect{Container: containerID, Force: force}
+	resp, err := cli.post("/networks/"+networkID+"/disconnect", nil, nd, nil)
+	ensureReaderClosed(resp)
+	return err
+}

+ 23 - 0
vendor/src/github.com/docker/engine-api/client/network_inspect.go

@@ -0,0 +1,23 @@
+package client
+
+import (
+	"encoding/json"
+	"net/http"
+
+	"github.com/docker/engine-api/types"
+)
+
+// NetworkInspect returns the information for a specific network configured in the docker host.
+func (cli *Client) NetworkInspect(networkID string) (types.NetworkResource, error) {
+	var networkResource types.NetworkResource
+	resp, err := cli.get("/networks/"+networkID, nil, nil)
+	if err != nil {
+		if resp.statusCode == http.StatusNotFound {
+			return networkResource, networkNotFoundError{networkID}
+		}
+		return networkResource, err
+	}
+	err = json.NewDecoder(resp.body).Decode(&networkResource)
+	ensureReaderClosed(resp)
+	return networkResource, err
+}

+ 30 - 0
vendor/src/github.com/docker/engine-api/client/network_list.go

@@ -0,0 +1,30 @@
+package client
+
+import (
+	"encoding/json"
+	"net/url"
+
+	"github.com/docker/engine-api/types"
+	"github.com/docker/engine-api/types/filters"
+)
+
+// NetworkList returns the list of networks configured in the docker host.
+func (cli *Client) NetworkList(options types.NetworkListOptions) ([]types.NetworkResource, error) {
+	query := url.Values{}
+	if options.Filters.Len() > 0 {
+		filterJSON, err := filters.ToParam(options.Filters)
+		if err != nil {
+			return nil, err
+		}
+
+		query.Set("filters", filterJSON)
+	}
+	var networkResources []types.NetworkResource
+	resp, err := cli.get("/networks", query, nil)
+	if err != nil {
+		return networkResources, err
+	}
+	err = json.NewDecoder(resp.body).Decode(&networkResources)
+	ensureReaderClosed(resp)
+	return networkResources, err
+}

+ 8 - 0
vendor/src/github.com/docker/engine-api/client/network_remove.go

@@ -0,0 +1,8 @@
+package client
+
+// NetworkRemove removes an existent network from the docker host.
+func (cli *Client) NetworkRemove(networkID string) error {
+	resp, err := cli.delete("/networks/"+networkID, nil, nil)
+	ensureReaderClosed(resp)
+	return err
+}

+ 0 - 66
vendor/src/github.com/docker/engine-api/client/volume.go

@@ -1,66 +0,0 @@
-package client
-
-import (
-	"encoding/json"
-	"net/http"
-	"net/url"
-
-	"github.com/docker/engine-api/types"
-	"github.com/docker/engine-api/types/filters"
-)
-
-// VolumeList returns the volumes configured in the docker host.
-func (cli *Client) VolumeList(filter filters.Args) (types.VolumesListResponse, error) {
-	var volumes types.VolumesListResponse
-	query := url.Values{}
-
-	if filter.Len() > 0 {
-		filterJSON, err := filters.ToParam(filter)
-		if err != nil {
-			return volumes, err
-		}
-		query.Set("filters", filterJSON)
-	}
-	resp, err := cli.get("/volumes", query, nil)
-	if err != nil {
-		return volumes, err
-	}
-
-	err = json.NewDecoder(resp.body).Decode(&volumes)
-	ensureReaderClosed(resp)
-	return volumes, err
-}
-
-// VolumeInspect returns the information about a specific volume in the docker host.
-func (cli *Client) VolumeInspect(volumeID string) (types.Volume, error) {
-	var volume types.Volume
-	resp, err := cli.get("/volumes/"+volumeID, nil, nil)
-	if err != nil {
-		if resp.statusCode == http.StatusNotFound {
-			return volume, volumeNotFoundError{volumeID}
-		}
-		return volume, err
-	}
-	err = json.NewDecoder(resp.body).Decode(&volume)
-	ensureReaderClosed(resp)
-	return volume, err
-}
-
-// VolumeCreate creates a volume in the docker host.
-func (cli *Client) VolumeCreate(options types.VolumeCreateRequest) (types.Volume, error) {
-	var volume types.Volume
-	resp, err := cli.post("/volumes/create", nil, options, nil)
-	if err != nil {
-		return volume, err
-	}
-	err = json.NewDecoder(resp.body).Decode(&volume)
-	ensureReaderClosed(resp)
-	return volume, err
-}
-
-// VolumeRemove removes a volume from the docker host.
-func (cli *Client) VolumeRemove(volumeID string) error {
-	resp, err := cli.delete("/volumes/"+volumeID, nil, nil)
-	ensureReaderClosed(resp)
-	return err
-}

+ 19 - 0
vendor/src/github.com/docker/engine-api/client/volume_create.go

@@ -0,0 +1,19 @@
+package client
+
+import (
+	"encoding/json"
+
+	"github.com/docker/engine-api/types"
+)
+
+// VolumeCreate creates a volume in the docker host.
+func (cli *Client) VolumeCreate(options types.VolumeCreateRequest) (types.Volume, error) {
+	var volume types.Volume
+	resp, err := cli.post("/volumes/create", nil, options, nil)
+	if err != nil {
+		return volume, err
+	}
+	err = json.NewDecoder(resp.body).Decode(&volume)
+	ensureReaderClosed(resp)
+	return volume, err
+}

+ 23 - 0
vendor/src/github.com/docker/engine-api/client/volume_inspect.go

@@ -0,0 +1,23 @@
+package client
+
+import (
+	"encoding/json"
+	"net/http"
+
+	"github.com/docker/engine-api/types"
+)
+
+// VolumeInspect returns the information about a specific volume in the docker host.
+func (cli *Client) VolumeInspect(volumeID string) (types.Volume, error) {
+	var volume types.Volume
+	resp, err := cli.get("/volumes/"+volumeID, nil, nil)
+	if err != nil {
+		if resp.statusCode == http.StatusNotFound {
+			return volume, volumeNotFoundError{volumeID}
+		}
+		return volume, err
+	}
+	err = json.NewDecoder(resp.body).Decode(&volume)
+	ensureReaderClosed(resp)
+	return volume, err
+}

+ 31 - 0
vendor/src/github.com/docker/engine-api/client/volume_list.go

@@ -0,0 +1,31 @@
+package client
+
+import (
+	"encoding/json"
+	"net/url"
+
+	"github.com/docker/engine-api/types"
+	"github.com/docker/engine-api/types/filters"
+)
+
+// VolumeList returns the volumes configured in the docker host.
+func (cli *Client) VolumeList(filter filters.Args) (types.VolumesListResponse, error) {
+	var volumes types.VolumesListResponse
+	query := url.Values{}
+
+	if filter.Len() > 0 {
+		filterJSON, err := filters.ToParam(filter)
+		if err != nil {
+			return volumes, err
+		}
+		query.Set("filters", filterJSON)
+	}
+	resp, err := cli.get("/volumes", query, nil)
+	if err != nil {
+		return volumes, err
+	}
+
+	err = json.NewDecoder(resp.body).Decode(&volumes)
+	ensureReaderClosed(resp)
+	return volumes, err
+}

+ 8 - 0
vendor/src/github.com/docker/engine-api/client/volume_remove.go

@@ -0,0 +1,8 @@
+package client
+
+// VolumeRemove removes a volume from the docker host.
+func (cli *Client) VolumeRemove(volumeID string) error {
+	resp, err := cli.delete("/volumes/"+volumeID, nil, nil)
+	ensureReaderClosed(resp)
+	return err
+}

+ 9 - 4
vendor/src/github.com/docker/engine-api/types/auth.go

@@ -2,10 +2,15 @@ package types
 
 
 // AuthConfig contains authorization information for connecting to a Registry
 // AuthConfig contains authorization information for connecting to a Registry
 type AuthConfig struct {
 type AuthConfig struct {
-	Username      string `json:"username,omitempty"`
-	Password      string `json:"password,omitempty"`
-	Auth          string `json:"auth,omitempty"`
-	Email         string `json:"email"`
+	Username string `json:"username,omitempty"`
+	Password string `json:"password,omitempty"`
+	Auth     string `json:"auth,omitempty"`
+
+	// Email is an optional value associated with the username.
+	// This field is deprecated and will be removed in a later
+	// version of docker.
+	Email string `json:"email,omitempty"`
+
 	ServerAddress string `json:"serveraddress,omitempty"`
 	ServerAddress string `json:"serveraddress,omitempty"`
 	RegistryToken string `json:"registrytoken,omitempty"`
 	RegistryToken string `json:"registrytoken,omitempty"`
 }
 }

+ 2 - 2
vendor/src/github.com/docker/engine-api/types/container/config.go

@@ -24,12 +24,12 @@ type Config struct {
 	OpenStdin       bool                  // Open stdin
 	OpenStdin       bool                  // Open stdin
 	StdinOnce       bool                  // If true, close stdin after the 1 attached client disconnects.
 	StdinOnce       bool                  // If true, close stdin after the 1 attached client disconnects.
 	Env             []string              // List of environment variable to set in the container
 	Env             []string              // List of environment variable to set in the container
-	Cmd             *strslice.StrSlice    // Command to run when starting the container
+	Cmd             strslice.StrSlice     // Command to run when starting the container
 	ArgsEscaped     bool                  `json:",omitempty"` // True if command is already escaped (Windows specific)
 	ArgsEscaped     bool                  `json:",omitempty"` // True if command is already escaped (Windows specific)
 	Image           string                // Name of the image as it was passed by the operator (eg. could be symbolic)
 	Image           string                // Name of the image as it was passed by the operator (eg. could be symbolic)
 	Volumes         map[string]struct{}   // List of volumes (mounts) used for the container
 	Volumes         map[string]struct{}   // List of volumes (mounts) used for the container
 	WorkingDir      string                // Current directory (PWD) in the command will be launched
 	WorkingDir      string                // Current directory (PWD) in the command will be launched
-	Entrypoint      *strslice.StrSlice    // Entrypoint to run when starting the container
+	Entrypoint      strslice.StrSlice     // Entrypoint to run when starting the container
 	NetworkDisabled bool                  `json:",omitempty"` // Is network disabled
 	NetworkDisabled bool                  `json:",omitempty"` // Is network disabled
 	MacAddress      string                `json:",omitempty"` // Mac Address of the container
 	MacAddress      string                `json:",omitempty"` // Mac Address of the container
 	OnBuild         []string              // ONBUILD metadata that were defined on the image Dockerfile
 	OnBuild         []string              // ONBUILD metadata that were defined on the image Dockerfile

+ 18 - 18
vendor/src/github.com/docker/engine-api/types/container/host_config.go

@@ -213,24 +213,24 @@ type HostConfig struct {
 	VolumesFrom     []string      // List of volumes to take from other container
 	VolumesFrom     []string      // List of volumes to take from other container
 
 
 	// Applicable to UNIX platforms
 	// Applicable to UNIX platforms
-	CapAdd          *strslice.StrSlice // List of kernel capabilities to add to the container
-	CapDrop         *strslice.StrSlice // List of kernel capabilities to remove from the container
-	DNS             []string           `json:"Dns"`        // List of DNS server to lookup
-	DNSOptions      []string           `json:"DnsOptions"` // List of DNSOption to look for
-	DNSSearch       []string           `json:"DnsSearch"`  // List of DNSSearch to look for
-	ExtraHosts      []string           // List of extra hosts
-	GroupAdd        []string           // List of additional groups that the container process will run as
-	IpcMode         IpcMode            // IPC namespace to use for the container
-	Links           []string           // List of links (in the name:alias form)
-	OomScoreAdj     int                // Container preference for OOM-killing
-	PidMode         PidMode            // PID namespace to use for the container
-	Privileged      bool               // Is the container in privileged mode
-	PublishAllPorts bool               // Should docker publish all exposed port for the container
-	ReadonlyRootfs  bool               // Is the container root filesystem in read-only
-	SecurityOpt     []string           // List of string values to customize labels for MLS systems, such as SELinux.
-	Tmpfs           map[string]string  `json:",omitempty"` // List of tmpfs (mounts) used for the container
-	UTSMode         UTSMode            // UTS namespace to use for the container
-	ShmSize         int64              // Total shm memory usage
+	CapAdd          strslice.StrSlice // List of kernel capabilities to add to the container
+	CapDrop         strslice.StrSlice // List of kernel capabilities to remove from the container
+	DNS             []string          `json:"Dns"`        // List of DNS server to lookup
+	DNSOptions      []string          `json:"DnsOptions"` // List of DNSOption to look for
+	DNSSearch       []string          `json:"DnsSearch"`  // List of DNSSearch to look for
+	ExtraHosts      []string          // List of extra hosts
+	GroupAdd        []string          // List of additional groups that the container process will run as
+	IpcMode         IpcMode           // IPC namespace to use for the container
+	Links           []string          // List of links (in the name:alias form)
+	OomScoreAdj     int               // Container preference for OOM-killing
+	PidMode         PidMode           // PID namespace to use for the container
+	Privileged      bool              // Is the container in privileged mode
+	PublishAllPorts bool              // Should docker publish all exposed port for the container
+	ReadonlyRootfs  bool              // Is the container root filesystem in read-only
+	SecurityOpt     []string          // List of string values to customize labels for MLS systems, such as SELinux.
+	Tmpfs           map[string]string `json:",omitempty"` // List of tmpfs (mounts) used for the container
+	UTSMode         UTSMode           // UTS namespace to use for the container
+	ShmSize         int64             // Total shm memory usage
 
 
 	// Applicable to Windows
 	// Applicable to Windows
 	ConsoleSize [2]int    // Initial console size
 	ConsoleSize [2]int    // Initial console size

+ 45 - 23
vendor/src/github.com/docker/engine-api/types/container/hostconfig_windows.go

@@ -15,9 +15,38 @@ func (n NetworkMode) IsNone() bool {
 	return n == "none"
 	return n == "none"
 }
 }
 
 
+// IsContainer indicates whether container uses a container network stack.
+// Returns false as windows doesn't support this mode
+func (n NetworkMode) IsContainer() bool {
+	return false
+}
+
+// IsBridge indicates whether container uses the bridge network stack
+// in windows it is given the name NAT
+func (n NetworkMode) IsBridge() bool {
+	return n == "nat"
+}
+
+// IsHost indicates whether container uses the host network stack.
+// returns false as this is not supported by windows
+func (n NetworkMode) IsHost() bool {
+	return false
+}
+
+// IsPrivate indicates whether container uses it's private network stack.
+func (n NetworkMode) IsPrivate() bool {
+	return !(n.IsHost() || n.IsContainer())
+}
+
+// ConnectedContainer is the id of the container which network this container is connected to.
+// Returns blank string on windows
+func (n NetworkMode) ConnectedContainer() string {
+	return ""
+}
+
 // IsUserDefined indicates user-created network
 // IsUserDefined indicates user-created network
 func (n NetworkMode) IsUserDefined() bool {
 func (n NetworkMode) IsUserDefined() bool {
-	return !n.IsDefault() && !n.IsNone()
+	return !n.IsDefault() && !n.IsNone() && !n.IsBridge()
 }
 }
 
 
 // IsHyperV indicates the use of a Hyper-V partition for isolation
 // IsHyperV indicates the use of a Hyper-V partition for isolation
@@ -35,34 +64,19 @@ func (i Isolation) IsValid() bool {
 	return i.IsDefault() || i.IsHyperV() || i.IsProcess()
 	return i.IsDefault() || i.IsHyperV() || i.IsProcess()
 }
 }
 
 
-// DefaultDaemonNetworkMode returns the default network stack the daemon should
-// use.
-func DefaultDaemonNetworkMode() NetworkMode {
-	return NetworkMode("default")
-}
-
 // NetworkName returns the name of the network stack.
 // NetworkName returns the name of the network stack.
 func (n NetworkMode) NetworkName() string {
 func (n NetworkMode) NetworkName() string {
 	if n.IsDefault() {
 	if n.IsDefault() {
 		return "default"
 		return "default"
+	} else if n.IsBridge() {
+		return "nat"
+	} else if n.IsNone() {
+		return "none"
+	} else if n.IsUserDefined() {
+		return n.UserDefined()
 	}
 	}
-	return ""
-}
 
 
-// ValidateNetMode ensures that the various combinations of requested
-// network settings are valid.
-func ValidateNetMode(c *Config, hc *HostConfig) error {
-	// We may not be passed a host config, such as in the case of docker commit
-	if hc == nil {
-		return nil
-	}
-	parts := strings.Split(string(hc.NetworkMode), ":")
-	switch mode := parts[0]; mode {
-	case "default", "none":
-	default:
-		return fmt.Errorf("invalid --net: %s", hc.NetworkMode)
-	}
-	return nil
+	return ""
 }
 }
 
 
 // ValidateIsolationperforms platform specific validation of the
 // ValidateIsolationperforms platform specific validation of the
@@ -78,3 +92,11 @@ func ValidateIsolation(hc *HostConfig) error {
 	}
 	}
 	return nil
 	return nil
 }
 }
+
+//UserDefined indicates user-created network
+func (n NetworkMode) UserDefined() string {
+	if n.IsUserDefined() {
+		return string(n)
+	}
+	return ""
+}

+ 8 - 49
vendor/src/github.com/docker/engine-api/types/strslice/strslice.go

@@ -1,29 +1,18 @@
 package strslice
 package strslice
 
 
-import (
-	"encoding/json"
-	"strings"
-)
+import "encoding/json"
 
 
 // StrSlice represents a string or an array of strings.
 // StrSlice represents a string or an array of strings.
 // We need to override the json decoder to accept both options.
 // We need to override the json decoder to accept both options.
-type StrSlice struct {
-	parts []string
-}
-
-// MarshalJSON Marshals (or serializes) the StrSlice into the json format.
-// This method is needed to implement json.Marshaller.
-func (e *StrSlice) MarshalJSON() ([]byte, error) {
-	if e == nil {
-		return []byte{}, nil
-	}
-	return json.Marshal(e.Slice())
-}
+type StrSlice []string
 
 
-// UnmarshalJSON decodes the byte slice whether it's a string or an array of strings.
-// This method is needed to implement json.Unmarshaler.
+// UnmarshalJSON decodes the byte slice whether it's a string or an array of
+// strings. This method is needed to implement json.Unmarshaler.
 func (e *StrSlice) UnmarshalJSON(b []byte) error {
 func (e *StrSlice) UnmarshalJSON(b []byte) error {
 	if len(b) == 0 {
 	if len(b) == 0 {
+		// With no input, we preserve the existing value by returning nil and
+		// leaving the target alone. This allows defining default values for
+		// the type.
 		return nil
 		return nil
 	}
 	}
 
 
@@ -36,36 +25,6 @@ func (e *StrSlice) UnmarshalJSON(b []byte) error {
 		p = append(p, s)
 		p = append(p, s)
 	}
 	}
 
 
-	e.parts = p
+	*e = p
 	return nil
 	return nil
 }
 }
-
-// Len returns the number of parts of the StrSlice.
-func (e *StrSlice) Len() int {
-	if e == nil {
-		return 0
-	}
-	return len(e.parts)
-}
-
-// Slice gets the parts of the StrSlice as a Slice of string.
-func (e *StrSlice) Slice() []string {
-	if e == nil {
-		return nil
-	}
-	return e.parts
-}
-
-// ToString gets space separated string of all the parts.
-func (e *StrSlice) ToString() string {
-	s := e.Slice()
-	if s == nil {
-		return ""
-	}
-	return strings.Join(s, " ")
-}
-
-// New creates an StrSlice based on the specified parts (as strings).
-func New(parts ...string) *StrSlice {
-	return &StrSlice{parts}
-}

+ 1 - 0
vendor/src/github.com/docker/engine-api/types/types.go

@@ -218,6 +218,7 @@ type Info struct {
 	SystemTime         string
 	SystemTime         string
 	ExecutionDriver    string
 	ExecutionDriver    string
 	LoggingDriver      string
 	LoggingDriver      string
+	CgroupDriver       string
 	NEventsListener    int
 	NEventsListener    int
 	KernelVersion      string
 	KernelVersion      string
 	OperatingSystem    string
 	OperatingSystem    string