Browse code

api/types: move ContainerStartOptions to api/types/container

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2023/08/26 06:44:29
Showing 23 changed files
... ...
@@ -43,12 +43,6 @@ type ContainerLogsOptions struct {
43 43
 	Details    bool
44 44
 }
45 45
 
46
-// ContainerStartOptions holds parameters to start containers.
47
-type ContainerStartOptions struct {
48
-	CheckpointID  string
49
-	CheckpointDir string
50
-}
51
-
52 46
 // CopyToContainerOptions holds information
53 47
 // about files to copy into a container
54 48
 type CopyToContainerOptions struct {
... ...
@@ -34,3 +34,9 @@ type RemoveOptions struct {
34 34
 	RemoveLinks   bool
35 35
 	Force         bool
36 36
 }
37
+
38
+// StartOptions holds parameters to start containers.
39
+type StartOptions struct {
40
+	CheckpointID  string
41
+	CheckpointDir string
42
+}
... ...
@@ -92,6 +92,11 @@ type ServiceCreateResponse = swarm.ServiceCreateResponse
92 92
 // Deprecated: use [swarm.ServiceUpdateResponse].
93 93
 type ServiceUpdateResponse = swarm.ServiceUpdateResponse
94 94
 
95
+// ContainerStartOptions holds parameters to start containers.
96
+//
97
+// Deprecated: use [container.StartOptions].
98
+type ContainerStartOptions = container.StartOptions
99
+
95 100
 // ResizeOptions holds parameters to resize a TTY.
96 101
 // It can be used to resize container TTYs and
97 102
 // exec process TTYs too.
... ...
@@ -4,11 +4,11 @@ import (
4 4
 	"context"
5 5
 	"net/url"
6 6
 
7
-	"github.com/docker/docker/api/types"
7
+	"github.com/docker/docker/api/types/container"
8 8
 )
9 9
 
10 10
 // ContainerStart sends a request to the docker daemon to start a container.
11
-func (cli *Client) ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error {
11
+func (cli *Client) ContainerStart(ctx context.Context, containerID string, options container.StartOptions) error {
12 12
 	query := url.Values{}
13 13
 	if len(options.CheckpointID) != 0 {
14 14
 		query.Set("checkpoint", options.CheckpointID)
... ...
@@ -10,7 +10,7 @@ import (
10 10
 	"strings"
11 11
 	"testing"
12 12
 
13
-	"github.com/docker/docker/api/types"
13
+	"github.com/docker/docker/api/types/container"
14 14
 	"github.com/docker/docker/errdefs"
15 15
 	"gotest.tools/v3/assert"
16 16
 	is "gotest.tools/v3/assert/cmp"
... ...
@@ -20,7 +20,7 @@ func TestContainerStartError(t *testing.T) {
20 20
 	client := &Client{
21 21
 		client: newMockClient(errorMock(http.StatusInternalServerError, "Server error")),
22 22
 	}
23
-	err := client.ContainerStart(context.Background(), "nothing", types.ContainerStartOptions{})
23
+	err := client.ContainerStart(context.Background(), "nothing", container.StartOptions{})
24 24
 	assert.Check(t, is.ErrorType(err, errdefs.IsSystem))
25 25
 }
26 26
 
... ...
@@ -51,7 +51,7 @@ func TestContainerStart(t *testing.T) {
51 51
 		}),
52 52
 	}
53 53
 
54
-	err := client.ContainerStart(context.Background(), "container_id", types.ContainerStartOptions{CheckpointID: "checkpoint_id"})
54
+	err := client.ContainerStart(context.Background(), "container_id", container.StartOptions{CheckpointID: "checkpoint_id"})
55 55
 	if err != nil {
56 56
 		t.Fatal(err)
57 57
 	}
... ...
@@ -69,7 +69,7 @@ type ContainerAPIClient interface {
69 69
 	ContainerStatPath(ctx context.Context, container, path string) (types.ContainerPathStat, error)
70 70
 	ContainerStats(ctx context.Context, container string, stream bool) (types.ContainerStats, error)
71 71
 	ContainerStatsOneShot(ctx context.Context, container string) (types.ContainerStats, error)
72
-	ContainerStart(ctx context.Context, container string, options types.ContainerStartOptions) error
72
+	ContainerStart(ctx context.Context, container string, options container.StartOptions) error
73 73
 	ContainerStop(ctx context.Context, container string, options container.StopOptions) error
74 74
 	ContainerTop(ctx context.Context, container string, arguments []string) (container.ContainerTopOKBody, error)
75 75
 	ContainerUnpause(ctx context.Context, container string) error
... ...
@@ -924,12 +924,12 @@ func (s *DockerAPISuite) TestContainerAPIStart(c *testing.T) {
924 924
 	_, err = apiClient.ContainerCreate(testutil.GetContext(c), &config, &container.HostConfig{}, &network.NetworkingConfig{}, nil, name)
925 925
 	assert.NilError(c, err)
926 926
 
927
-	err = apiClient.ContainerStart(testutil.GetContext(c), name, types.ContainerStartOptions{})
927
+	err = apiClient.ContainerStart(testutil.GetContext(c), name, container.StartOptions{})
928 928
 	assert.NilError(c, err)
929 929
 
930 930
 	// second call to start should give 304
931 931
 	// maybe add ContainerStartWithRaw to test it
932
-	err = apiClient.ContainerStart(testutil.GetContext(c), name, types.ContainerStartOptions{})
932
+	err = apiClient.ContainerStart(testutil.GetContext(c), name, container.StartOptions{})
933 933
 	assert.NilError(c, err)
934 934
 
935 935
 	// TODO(tibor): figure out why this doesn't work on windows
... ...
@@ -1572,7 +1572,7 @@ func (s *DockerAPISuite) TestContainerAPIStatsWithNetworkDisabled(c *testing.T)
1572 1572
 	_, err = apiClient.ContainerCreate(testutil.GetContext(c), &config, &container.HostConfig{}, &network.NetworkingConfig{}, nil, name)
1573 1573
 	assert.NilError(c, err)
1574 1574
 
1575
-	err = apiClient.ContainerStart(testutil.GetContext(c), name, types.ContainerStartOptions{})
1575
+	err = apiClient.ContainerStart(testutil.GetContext(c), name, container.StartOptions{})
1576 1576
 	assert.NilError(c, err)
1577 1577
 
1578 1578
 	assert.Assert(c, waitRun(name) == nil)
... ...
@@ -2112,7 +2112,7 @@ func (s *DockerAPISuite) TestContainersAPICreateMountsCreate(c *testing.T) {
2112 2112
 			assert.Check(c, is.Equal(x.expected.Mode, mountPoint.Mode))
2113 2113
 			assert.Check(c, is.Equal(x.expected.Destination, mountPoint.Destination))
2114 2114
 
2115
-			err = apiclient.ContainerStart(ctx, ctr.ID, types.ContainerStartOptions{})
2115
+			err = apiclient.ContainerStart(ctx, ctr.ID, container.StartOptions{})
2116 2116
 			assert.NilError(c, err)
2117 2117
 			poll.WaitOn(c, containerExit(ctx, apiclient, ctr.ID), poll.WithDelay(time.Second))
2118 2118
 
... ...
@@ -10,7 +10,6 @@ import (
10 10
 	"testing"
11 11
 
12 12
 	winio "github.com/Microsoft/go-winio"
13
-	"github.com/docker/docker/api/types"
14 13
 	"github.com/docker/docker/api/types/container"
15 14
 	"github.com/docker/docker/api/types/mount"
16 15
 	"github.com/docker/docker/testutil"
... ...
@@ -66,7 +65,7 @@ func (s *DockerAPISuite) TestContainersAPICreateMountsBindNamedPipe(c *testing.T
66 66
 		nil, nil, name)
67 67
 	assert.NilError(c, err)
68 68
 
69
-	err = client.ContainerStart(ctx, name, types.ContainerStartOptions{})
69
+	err = client.ContainerStart(ctx, name, container.StartOptions{})
70 70
 	assert.NilError(c, err)
71 71
 
72 72
 	err = <-ch
... ...
@@ -8,8 +8,8 @@ import (
8 8
 	"testing"
9 9
 	"time"
10 10
 
11
-	"github.com/docker/docker/api/types"
12 11
 	"github.com/docker/docker/api/types/checkpoint"
12
+	containertypes "github.com/docker/docker/api/types/container"
13 13
 	mounttypes "github.com/docker/docker/api/types/mount"
14 14
 	"github.com/docker/docker/client"
15 15
 	"github.com/docker/docker/integration/internal/container"
... ...
@@ -128,7 +128,7 @@ func TestCheckpoint(t *testing.T) {
128 128
 
129 129
 	// Restore the container from a second checkpoint.
130 130
 	t.Log("Restore the container")
131
-	err = apiClient.ContainerStart(ctx, cID, types.ContainerStartOptions{
131
+	err = apiClient.ContainerStart(ctx, cID, containertypes.StartOptions{
132 132
 		CheckpointID: "test2",
133 133
 	})
134 134
 	assert.NilError(t, err)
... ...
@@ -8,9 +8,7 @@ import (
8 8
 	"testing"
9 9
 	"time"
10 10
 
11
-	"github.com/docker/docker/api/types"
12 11
 	"github.com/docker/docker/api/types/container"
13
-	containertypes "github.com/docker/docker/api/types/container"
14 12
 	"github.com/docker/docker/api/types/network"
15 13
 	"github.com/docker/docker/api/types/versions"
16 14
 	"github.com/docker/docker/client"
... ...
@@ -253,7 +251,7 @@ func TestCreateWithCustomMaskedPaths(t *testing.T) {
253 253
 		checkInspect(t, ctx, name, tc.expected)
254 254
 
255 255
 		// Start the container.
256
-		err = apiClient.ContainerStart(ctx, c.ID, types.ContainerStartOptions{})
256
+		err = apiClient.ContainerStart(ctx, c.ID, container.StartOptions{})
257 257
 		assert.NilError(t, err)
258 258
 
259 259
 		poll.WaitOn(t, ctr.IsInState(ctx, apiClient, c.ID, "exited"), poll.WithDelay(100*time.Millisecond))
... ...
@@ -331,7 +329,7 @@ func TestCreateWithCustomReadonlyPaths(t *testing.T) {
331 331
 		checkInspect(t, ctx, name, tc.expected)
332 332
 
333 333
 		// Start the container.
334
-		err = apiClient.ContainerStart(ctx, c.ID, types.ContainerStartOptions{})
334
+		err = apiClient.ContainerStart(ctx, c.ID, container.StartOptions{})
335 335
 		assert.NilError(t, err)
336 336
 
337 337
 		poll.WaitOn(t, ctr.IsInState(ctx, apiClient, c.ID, "exited"), poll.WithDelay(100*time.Millisecond))
... ...
@@ -436,7 +434,7 @@ func TestCreateTmpfsOverrideAnonymousVolume(t *testing.T) {
436 436
 	)
437 437
 
438 438
 	defer func() {
439
-		err := apiClient.ContainerRemove(ctx, id, containertypes.RemoveOptions{Force: true})
439
+		err := apiClient.ContainerRemove(ctx, id, container.RemoveOptions{Force: true})
440 440
 		assert.NilError(t, err)
441 441
 	}()
442 442
 
... ...
@@ -447,7 +445,7 @@ func TestCreateTmpfsOverrideAnonymousVolume(t *testing.T) {
447 447
 	assert.Assert(t, is.Len(inspect.Mounts, 0))
448 448
 
449 449
 	chWait, chErr := apiClient.ContainerWait(ctx, id, container.WaitConditionNextExit)
450
-	assert.NilError(t, apiClient.ContainerStart(ctx, id, types.ContainerStartOptions{}))
450
+	assert.NilError(t, apiClient.ContainerStart(ctx, id, container.StartOptions{}))
451 451
 
452 452
 	timeout := time.NewTimer(30 * time.Second)
453 453
 	defer timeout.Stop()
... ...
@@ -483,7 +481,7 @@ func TestCreateDifferentPlatform(t *testing.T) {
483 483
 			Architecture: img.Architecture,
484 484
 			Variant:      img.Variant,
485 485
 		}
486
-		_, err := apiClient.ContainerCreate(ctx, &containertypes.Config{Image: "busybox:latest"}, &containertypes.HostConfig{}, nil, &p, "")
486
+		_, err := apiClient.ContainerCreate(ctx, &container.Config{Image: "busybox:latest"}, &container.HostConfig{}, nil, &p, "")
487 487
 		assert.Check(t, is.ErrorType(err, errdefs.IsNotFound))
488 488
 	})
489 489
 	t.Run("different cpu arch", func(t *testing.T) {
... ...
@@ -493,7 +491,7 @@ func TestCreateDifferentPlatform(t *testing.T) {
493 493
 			Architecture: img.Architecture + "DifferentArch",
494 494
 			Variant:      img.Variant,
495 495
 		}
496
-		_, err := apiClient.ContainerCreate(ctx, &containertypes.Config{Image: "busybox:latest"}, &containertypes.HostConfig{}, nil, &p, "")
496
+		_, err := apiClient.ContainerCreate(ctx, &container.Config{Image: "busybox:latest"}, &container.HostConfig{}, nil, &p, "")
497 497
 		assert.Check(t, is.ErrorType(err, errdefs.IsNotFound))
498 498
 	})
499 499
 }
... ...
@@ -541,32 +539,32 @@ func TestCreateInvalidHostConfig(t *testing.T) {
541 541
 
542 542
 	testCases := []struct {
543 543
 		doc         string
544
-		hc          containertypes.HostConfig
544
+		hc          container.HostConfig
545 545
 		expectedErr string
546 546
 	}{
547 547
 		{
548 548
 			doc:         "invalid IpcMode",
549
-			hc:          containertypes.HostConfig{IpcMode: "invalid"},
549
+			hc:          container.HostConfig{IpcMode: "invalid"},
550 550
 			expectedErr: "Error response from daemon: invalid IPC mode: invalid",
551 551
 		},
552 552
 		{
553 553
 			doc:         "invalid PidMode",
554
-			hc:          containertypes.HostConfig{PidMode: "invalid"},
554
+			hc:          container.HostConfig{PidMode: "invalid"},
555 555
 			expectedErr: "Error response from daemon: invalid PID mode: invalid",
556 556
 		},
557 557
 		{
558 558
 			doc:         "invalid PidMode without container ID",
559
-			hc:          containertypes.HostConfig{PidMode: "container"},
559
+			hc:          container.HostConfig{PidMode: "container"},
560 560
 			expectedErr: "Error response from daemon: invalid PID mode: container",
561 561
 		},
562 562
 		{
563 563
 			doc:         "invalid UTSMode",
564
-			hc:          containertypes.HostConfig{UTSMode: "invalid"},
564
+			hc:          container.HostConfig{UTSMode: "invalid"},
565 565
 			expectedErr: "Error response from daemon: invalid UTS mode: invalid",
566 566
 		},
567 567
 		{
568 568
 			doc:         "invalid Annotations",
569
-			hc:          containertypes.HostConfig{Annotations: map[string]string{"": "a"}},
569
+			hc:          container.HostConfig{Annotations: map[string]string{"": "a"}},
570 570
 			expectedErr: "Error response from daemon: invalid Annotations: the empty string is not permitted as an annotation key",
571 571
 		},
572 572
 	}
... ...
@@ -49,7 +49,7 @@ func TestContainerStartOnDaemonRestart(t *testing.T) {
49 49
 	cID := container.Create(ctx, t, c)
50 50
 	defer c.ContainerRemove(ctx, cID, containertypes.RemoveOptions{Force: true})
51 51
 
52
-	err := c.ContainerStart(ctx, cID, types.ContainerStartOptions{})
52
+	err := c.ContainerStart(ctx, cID, containertypes.StartOptions{})
53 53
 	assert.Check(t, err, "error starting test container")
54 54
 
55 55
 	inspect, err := c.ContainerInspect(ctx, cID)
... ...
@@ -68,7 +68,7 @@ func TestContainerStartOnDaemonRestart(t *testing.T) {
68 68
 
69 69
 	d.Start(t, "--iptables=false")
70 70
 
71
-	err = c.ContainerStart(ctx, cID, types.ContainerStartOptions{})
71
+	err = c.ContainerStart(ctx, cID, containertypes.StartOptions{})
72 72
 	assert.Check(t, err, "failed to start test container")
73 73
 }
74 74
 
... ...
@@ -4,7 +4,6 @@ import (
4 4
 	"strings"
5 5
 	"testing"
6 6
 
7
-	"github.com/docker/docker/api/types"
8 7
 	containertypes "github.com/docker/docker/api/types/container"
9 8
 	"github.com/docker/docker/integration/internal/container"
10 9
 	"github.com/docker/docker/testutil"
... ...
@@ -100,7 +99,7 @@ func TestWindowsDevices(t *testing.T) {
100 100
 			// remove this skip.If and validate the expected behaviour under Hyper-V.
101 101
 			skip.If(t, d.isolation == containertypes.IsolationHyperV && !d.expectedStartFailure, "FIXME. HyperV isolation setup is probably incorrect in the test")
102 102
 
103
-			err := apiClient.ContainerStart(ctx, id, types.ContainerStartOptions{})
103
+			err := apiClient.ContainerStart(ctx, id, containertypes.StartOptions{})
104 104
 			if d.expectedStartFailure {
105 105
 				assert.ErrorContains(t, err, d.expectedStartFailureMessage)
106 106
 				return
... ...
@@ -7,7 +7,6 @@ import (
7 7
 	"strings"
8 8
 	"testing"
9 9
 
10
-	"github.com/docker/docker/api/types"
11 10
 	containertypes "github.com/docker/docker/api/types/container"
12 11
 	"github.com/docker/docker/api/types/versions"
13 12
 	"github.com/docker/docker/client"
... ...
@@ -68,7 +67,7 @@ func testIpcNonePrivateShareable(t *testing.T, mode string, mustBeMounted bool,
68 68
 	assert.NilError(t, err)
69 69
 	assert.Check(t, is.Equal(len(resp.Warnings), 0))
70 70
 
71
-	err = apiClient.ContainerStart(ctx, resp.ID, types.ContainerStartOptions{})
71
+	err = apiClient.ContainerStart(ctx, resp.ID, containertypes.StartOptions{})
72 72
 	assert.NilError(t, err)
73 73
 
74 74
 	// get major:minor pair for /dev/shm from container's /proc/self/mountinfo
... ...
@@ -140,7 +139,7 @@ func testIpcContainer(t *testing.T, donorMode string, mustWork bool) {
140 140
 	assert.Check(t, is.Equal(len(resp.Warnings), 0))
141 141
 	name1 := resp.ID
142 142
 
143
-	err = apiClient.ContainerStart(ctx, name1, types.ContainerStartOptions{})
143
+	err = apiClient.ContainerStart(ctx, name1, containertypes.StartOptions{})
144 144
 	assert.NilError(t, err)
145 145
 
146 146
 	// create and start the second container
... ...
@@ -150,7 +149,7 @@ func testIpcContainer(t *testing.T, donorMode string, mustWork bool) {
150 150
 	assert.Check(t, is.Equal(len(resp.Warnings), 0))
151 151
 	name2 := resp.ID
152 152
 
153
-	err = apiClient.ContainerStart(ctx, name2, types.ContainerStartOptions{})
153
+	err = apiClient.ContainerStart(ctx, name2, containertypes.StartOptions{})
154 154
 	if !mustWork {
155 155
 		// start should fail with a specific error
156 156
 		assert.Check(t, is.ErrorContains(err, "non-shareable IPC"))
... ...
@@ -206,7 +205,7 @@ func TestAPIIpcModeHost(t *testing.T) {
206 206
 	assert.Check(t, is.Equal(len(resp.Warnings), 0))
207 207
 	name := resp.ID
208 208
 
209
-	err = apiClient.ContainerStart(ctx, name, types.ContainerStartOptions{})
209
+	err = apiClient.ContainerStart(ctx, name, containertypes.StartOptions{})
210 210
 	assert.NilError(t, err)
211 211
 
212 212
 	// check that IPC is shared
... ...
@@ -241,7 +240,7 @@ func testDaemonIpcPrivateShareable(t *testing.T, mustBeShared bool, arg ...strin
241 241
 	assert.NilError(t, err)
242 242
 	assert.Check(t, is.Equal(len(resp.Warnings), 0))
243 243
 
244
-	err = c.ContainerStart(ctx, resp.ID, types.ContainerStartOptions{})
244
+	err = c.ContainerStart(ctx, resp.ID, containertypes.StartOptions{})
245 245
 	assert.NilError(t, err)
246 246
 
247 247
 	// get major:minor pair for /dev/shm from container's /proc/self/mountinfo
... ...
@@ -8,7 +8,6 @@ import (
8 8
 	"testing"
9 9
 	"time"
10 10
 
11
-	"github.com/docker/docker/api/types"
12 11
 	containertypes "github.com/docker/docker/api/types/container"
13 12
 	mounttypes "github.com/docker/docker/api/types/mount"
14 13
 	"github.com/docker/docker/api/types/network"
... ...
@@ -67,7 +66,7 @@ func TestContainerNetworkMountsNoChown(t *testing.T) {
67 67
 	ctrCreate, err := cli.ContainerCreate(ctx, &config, &hostConfig, &network.NetworkingConfig{}, nil, "")
68 68
 	assert.NilError(t, err)
69 69
 	// container will exit immediately because of no tty, but we only need the start sequence to test the condition
70
-	err = cli.ContainerStart(ctx, ctrCreate.ID, types.ContainerStartOptions{})
70
+	err = cli.ContainerStart(ctx, ctrCreate.ID, containertypes.StartOptions{})
71 71
 	assert.NilError(t, err)
72 72
 
73 73
 	// Check that host-located bind mount network file did not change ownership when the container was started
... ...
@@ -4,7 +4,7 @@ import (
4 4
 	"os"
5 5
 	"testing"
6 6
 
7
-	"github.com/docker/docker/api/types"
7
+	containertypes "github.com/docker/docker/api/types/container"
8 8
 	"github.com/docker/docker/errdefs"
9 9
 	"github.com/docker/docker/integration/internal/container"
10 10
 	"gotest.tools/v3/assert"
... ...
@@ -50,7 +50,7 @@ func TestPIDModeContainer(t *testing.T) {
50 50
 		ctr, err := container.CreateFromConfig(ctx, apiClient, container.NewTestConfig(container.WithPIDMode("container:"+pidCtrName)))
51 51
 		assert.NilError(t, err, "should not produce an error when creating, only when starting")
52 52
 
53
-		err = apiClient.ContainerStart(ctx, ctr.ID, types.ContainerStartOptions{})
53
+		err = apiClient.ContainerStart(ctx, ctr.ID, containertypes.StartOptions{})
54 54
 		assert.Check(t, is.ErrorType(err, errdefs.IsSystem), "should produce a System error when starting an existing container from an invalid state")
55 55
 		assert.Check(t, is.ErrorContains(err, "failed to join PID namespace"))
56 56
 		assert.Check(t, is.ErrorContains(err, cPIDContainerID+" is not running"))
... ...
@@ -63,7 +63,7 @@ func TestPIDModeContainer(t *testing.T) {
63 63
 		ctr, err := container.CreateFromConfig(ctx, apiClient, container.NewTestConfig(container.WithPIDMode("container:"+pidCtrName)))
64 64
 		assert.NilError(t, err)
65 65
 
66
-		err = apiClient.ContainerStart(ctx, ctr.ID, types.ContainerStartOptions{})
66
+		err = apiClient.ContainerStart(ctx, ctr.ID, containertypes.StartOptions{})
67 67
 		assert.Check(t, err)
68 68
 	})
69 69
 }
... ...
@@ -135,7 +135,7 @@ func TestRenameAnonymousContainer(t *testing.T) {
135 135
 	// FIXME(vdemeester) this is a really weird behavior as it fails otherwise
136 136
 	err = apiClient.ContainerStop(ctx, container1Name, containertypes.StopOptions{})
137 137
 	assert.NilError(t, err)
138
-	err = apiClient.ContainerStart(ctx, container1Name, types.ContainerStartOptions{})
138
+	err = apiClient.ContainerStart(ctx, container1Name, containertypes.StartOptions{})
139 139
 	assert.NilError(t, err)
140 140
 
141 141
 	count := "-c"
... ...
@@ -6,7 +6,6 @@ import (
6 6
 	"testing"
7 7
 	"time"
8 8
 
9
-	"github.com/docker/docker/api/types"
10 9
 	"github.com/docker/docker/api/types/container"
11 10
 	"github.com/docker/docker/client"
12 11
 	testContainer "github.com/docker/docker/integration/internal/container"
... ...
@@ -105,7 +104,7 @@ func TestDaemonRestartKillContainers(t *testing.T) {
105 105
 					defer apiClient.ContainerRemove(ctx, resp.ID, container.RemoveOptions{Force: true})
106 106
 
107 107
 					if tc.xStart {
108
-						err = apiClient.ContainerStart(ctx, resp.ID, types.ContainerStartOptions{})
108
+						err = apiClient.ContainerStart(ctx, resp.ID, container.StartOptions{})
109 109
 						assert.NilError(t, err)
110 110
 					}
111 111
 
... ...
@@ -4,7 +4,6 @@ import (
4 4
 	"testing"
5 5
 	"time"
6 6
 
7
-	"github.com/docker/docker/api/types"
8 7
 	containertypes "github.com/docker/docker/api/types/container"
9 8
 	"github.com/docker/docker/integration/internal/container"
10 9
 	"github.com/docker/docker/testutil"
... ...
@@ -149,7 +148,7 @@ func TestWaitConditions(t *testing.T) {
149 149
 			assert.NilError(t, err)
150 150
 			defer streams.Close()
151 151
 
152
-			assert.NilError(t, cli.ContainerStart(ctx, containerID, types.ContainerStartOptions{}))
152
+			assert.NilError(t, cli.ContainerStart(ctx, containerID, containertypes.StartOptions{}))
153 153
 			waitResC, errC := cli.ContainerWait(ctx, containerID, tc.waitCond)
154 154
 			select {
155 155
 			case err := <-errC:
... ...
@@ -77,7 +77,7 @@ func Run(ctx context.Context, t *testing.T, apiClient client.APIClient, ops ...f
77 77
 	t.Helper()
78 78
 	id := Create(ctx, t, apiClient, ops...)
79 79
 
80
-	err := apiClient.ContainerStart(ctx, id, types.ContainerStartOptions{})
80
+	err := apiClient.ContainerStart(ctx, id, container.StartOptions{})
81 81
 	assert.NilError(t, err)
82 82
 
83 83
 	return id
... ...
@@ -106,7 +106,7 @@ func RunAttach(ctx context.Context, t *testing.T, apiClient client.APIClient, op
106 106
 	})
107 107
 	assert.NilError(t, err)
108 108
 
109
-	err = apiClient.ContainerStart(ctx, id, types.ContainerStartOptions{})
109
+	err = apiClient.ContainerStart(ctx, id, container.StartOptions{})
110 110
 	assert.NilError(t, err)
111 111
 
112 112
 	s, err := demultiplexStreams(ctx, aresp)
... ...
@@ -62,7 +62,7 @@ func TestReadPluginNoRead(t *testing.T) {
62 62
 			assert.Assert(t, err)
63 63
 			defer client.ContainerRemove(ctx, c.ID, container.RemoveOptions{Force: true})
64 64
 
65
-			err = client.ContainerStart(ctx, c.ID, types.ContainerStartOptions{})
65
+			err = client.ContainerStart(ctx, c.ID, container.StartOptions{})
66 66
 			assert.Assert(t, err)
67 67
 
68 68
 			logs, err := client.ContainerLogs(ctx, c.ID, types.ContainerLogsOptions{ShowStdout: true})
... ...
@@ -3,7 +3,7 @@ package service // import "github.com/docker/docker/integration/service"
3 3
 import (
4 4
 	"testing"
5 5
 
6
-	"github.com/docker/docker/api/types"
6
+	containertypes "github.com/docker/docker/api/types/container"
7 7
 	"github.com/docker/docker/api/types/network"
8 8
 	"github.com/docker/docker/integration/internal/container"
9 9
 	net "github.com/docker/docker/integration/internal/network"
... ...
@@ -43,7 +43,7 @@ func TestDockerNetworkConnectAlias(t *testing.T) {
43 43
 	})
44 44
 	assert.NilError(t, err)
45 45
 
46
-	err = client.ContainerStart(ctx, cID1, types.ContainerStartOptions{})
46
+	err = client.ContainerStart(ctx, cID1, containertypes.StartOptions{})
47 47
 	assert.NilError(t, err)
48 48
 
49 49
 	ng1, err := client.ContainerInspect(ctx, cID1)
... ...
@@ -66,7 +66,7 @@ func TestDockerNetworkConnectAlias(t *testing.T) {
66 66
 	})
67 67
 	assert.NilError(t, err)
68 68
 
69
-	err = client.ContainerStart(ctx, cID2, types.ContainerStartOptions{})
69
+	err = client.ContainerStart(ctx, cID2, containertypes.StartOptions{})
70 70
 	assert.NilError(t, err)
71 71
 
72 72
 	ng2, err := client.ContainerInspect(ctx, cID2)
... ...
@@ -101,7 +101,7 @@ func TestDockerNetworkReConnect(t *testing.T) {
101 101
 	err := client.NetworkConnect(ctx, name, c1, &network.EndpointSettings{})
102 102
 	assert.NilError(t, err)
103 103
 
104
-	err = client.ContainerStart(ctx, c1, types.ContainerStartOptions{})
104
+	err = client.ContainerStart(ctx, c1, containertypes.StartOptions{})
105 105
 	assert.NilError(t, err)
106 106
 
107 107
 	n1, err := client.ContainerInspect(ctx, c1)
... ...
@@ -4,7 +4,6 @@ import (
4 4
 	"os"
5 5
 	"testing"
6 6
 
7
-	"github.com/docker/docker/api/types"
8 7
 	containertypes "github.com/docker/docker/api/types/container"
9 8
 	"github.com/docker/docker/integration/internal/container"
10 9
 	"github.com/docker/docker/testutil"
... ...
@@ -48,7 +47,7 @@ func TestCgroupDriverSystemdMemoryLimit(t *testing.T) {
48 48
 	})
49 49
 	defer c.ContainerRemove(ctx, ctrID, containertypes.RemoveOptions{Force: true})
50 50
 
51
-	err := c.ContainerStart(ctx, ctrID, types.ContainerStartOptions{})
51
+	err := c.ContainerStart(ctx, ctrID, containertypes.StartOptions{})
52 52
 	assert.NilError(t, err)
53 53
 
54 54
 	s, err := c.ContainerInspect(ctx, ctrID)
... ...
@@ -157,7 +157,7 @@ COPY . /static`); err != nil {
157 157
 		Image: image,
158 158
 	}, &containertypes.HostConfig{}, nil, nil, container)
159 159
 	assert.NilError(t, err)
160
-	err = c.ContainerStart(context.Background(), b.ID, types.ContainerStartOptions{})
160
+	err = c.ContainerStart(context.Background(), b.ID, containertypes.StartOptions{})
161 161
 	assert.NilError(t, err)
162 162
 
163 163
 	// Find out the system assigned port