Browse code

Update to new swarmkit/engine-api

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>

Tonis Tiigi authored on 2016/07/01 06:04:02
Showing 6 changed files
... ...
@@ -28,7 +28,7 @@ func New(client client.APIClient, noResolve bool) *IDResolver {
28 28
 func (r *IDResolver) get(ctx context.Context, t interface{}, id string) (string, error) {
29 29
 	switch t.(type) {
30 30
 	case swarm.Node:
31
-		node, err := r.client.NodeInspect(ctx, id)
31
+		node, _, err := r.client.NodeInspectWithRaw(ctx, id)
32 32
 		if err != nil {
33 33
 			return id, nil
34 34
 		}
... ...
@@ -49,7 +49,7 @@ func runInspect(dockerCli *client.DockerCli, opts inspectOptions) error {
49 49
 		if err != nil {
50 50
 			return nil, nil, err
51 51
 		}
52
-		node, err := client.NodeInspect(ctx, nodeRef)
52
+		node, _, err := client.NodeInspectWithRaw(ctx, nodeRef)
53 53
 		return node, nil, err
54 54
 	}
55 55
 
... ...
@@ -48,7 +48,7 @@ func runTasks(dockerCli *client.DockerCli, opts tasksOptions) error {
48 48
 	if err != nil {
49 49
 		return nil
50 50
 	}
51
-	node, err := client.NodeInspect(ctx, nodeRef)
51
+	node, _, err := client.NodeInspectWithRaw(ctx, nodeRef)
52 52
 	if err != nil {
53 53
 		return err
54 54
 	}
... ...
@@ -42,7 +42,7 @@ func updateNodes(dockerCli *client.DockerCli, nodes []string, mergeNode func(nod
42 42
 	ctx := context.Background()
43 43
 
44 44
 	for _, nodeID := range nodes {
45
-		node, err := client.NodeInspect(ctx, nodeID)
45
+		node, _, err := client.NodeInspectWithRaw(ctx, nodeID)
46 46
 		if err != nil {
47 47
 			return err
48 48
 		}
... ...
@@ -117,8 +117,8 @@ func (c *containerConfig) config() *enginecontainer.Config {
117 117
 		// If Command is provided, we replace the whole invocation with Command
118 118
 		// by replacing Entrypoint and specifying Cmd. Args is ignored in this
119 119
 		// case.
120
-		config.Entrypoint = append(config.Entrypoint, c.spec().Command[0])
121
-		config.Cmd = append(config.Cmd, c.spec().Command[1:]...)
120
+		config.Entrypoint = append(config.Entrypoint, c.spec().Command...)
121
+		config.Cmd = append(config.Cmd, c.spec().Args...)
122 122
 	} else if len(c.spec().Args) > 0 {
123 123
 		// In this case, we assume the image has an Entrypoint and Args
124 124
 		// specifies the arguments for that entrypoint.
... ...
@@ -5,7 +5,6 @@ import (
5 5
 
6 6
 	"github.com/docker/docker/container"
7 7
 	"github.com/docker/docker/libcontainerd"
8
-	"github.com/docker/engine-api/types"
9 8
 )
10 9
 
11 10
 func (daemon *Daemon) getLibcontainerdCreateOptions(container *container.Container) (*[]libcontainerd.CreateOption, error) {
... ...
@@ -13,7 +12,7 @@ func (daemon *Daemon) getLibcontainerdCreateOptions(container *container.Contain
13 13
 
14 14
 	// Ensure a runtime has been assigned to this container
15 15
 	if container.HostConfig.Runtime == "" {
16
-		container.HostConfig.Runtime = types.DefaultRuntimeName
16
+		container.HostConfig.Runtime = stockRuntimeName
17 17
 		container.ToDisk()
18 18
 	}
19 19