@@ -13,6 +13,7 @@ import (
1313 "github.com/docker/cli/internal/test"
1414 "github.com/docker/cli/opts"
1515 "github.com/moby/moby/api/types/container"
16+ "github.com/moby/moby/client"
1617 "gotest.tools/v3/assert"
1718 is "gotest.tools/v3/assert/cmp"
1819 "gotest.tools/v3/fs"
@@ -38,18 +39,18 @@ TWO=2
3839 testcases := []struct {
3940 options ExecOptions
4041 configFile configfile.ConfigFile
41- expected container. ExecOptions
42+ expected client. ExecCreateOptions
4243 }{
4344 {
44- expected : container. ExecOptions {
45+ expected : client. ExecCreateOptions {
4546 Cmd : []string {"command" },
4647 AttachStdout : true ,
4748 AttachStderr : true ,
4849 },
4950 options : withDefaultOpts (ExecOptions {}),
5051 },
5152 {
52- expected : container. ExecOptions {
53+ expected : client. ExecCreateOptions {
5354 Cmd : []string {"command1" , "command2" },
5455 AttachStdout : true ,
5556 AttachStderr : true ,
6465 TTY : true ,
6566 User : "uid" ,
6667 }),
67- expected : container. ExecOptions {
68+ expected : client. ExecCreateOptions {
6869 User : "uid" ,
6970 AttachStdin : true ,
7071 AttachStdout : true ,
7576 },
7677 {
7778 options : withDefaultOpts (ExecOptions {Detach : true }),
78- expected : container. ExecOptions {
79+ expected : client. ExecCreateOptions {
7980 Cmd : []string {"command" },
8081 },
8182 },
@@ -85,15 +86,15 @@ TWO=2
8586 Interactive : true ,
8687 Detach : true ,
8788 }),
88- expected : container. ExecOptions {
89+ expected : client. ExecCreateOptions {
8990 Tty : true ,
9091 Cmd : []string {"command" },
9192 },
9293 },
9394 {
9495 options : withDefaultOpts (ExecOptions {Detach : true }),
9596 configFile : configfile.ConfigFile {DetachKeys : "de" },
96- expected : container. ExecOptions {
97+ expected : client. ExecCreateOptions {
9798 Cmd : []string {"command" },
9899 DetachKeys : "de" ,
99100 },
@@ -104,13 +105,13 @@ TWO=2
104105 DetachKeys : "ab" ,
105106 }),
106107 configFile : configfile.ConfigFile {DetachKeys : "de" },
107- expected : container. ExecOptions {
108+ expected : client. ExecCreateOptions {
108109 Cmd : []string {"command" },
109110 DetachKeys : "ab" ,
110111 },
111112 },
112113 {
113- expected : container. ExecOptions {
114+ expected : client. ExecCreateOptions {
114115 Cmd : []string {"command" },
115116 AttachStdout : true ,
116117 AttachStderr : true ,
@@ -123,7 +124,7 @@ TWO=2
123124 }(),
124125 },
125126 {
126- expected : container. ExecOptions {
127+ expected : client. ExecCreateOptions {
127128 Cmd : []string {"command" },
128129 AttachStdout : true ,
129130 AttachStderr : true ,
@@ -206,7 +207,7 @@ func TestRunExec(t *testing.T) {
206207 }
207208}
208209
209- func execCreateWithID (_ string , _ container. ExecOptions ) (container.ExecCreateResponse , error ) {
210+ func execCreateWithID (_ string , _ client. ExecCreateOptions ) (container.ExecCreateResponse , error ) {
210211 return container.ExecCreateResponse {ID : "execid" }, nil
211212}
212213
@@ -235,9 +236,9 @@ func TestGetExecExitStatus(t *testing.T) {
235236
236237 for _ , testcase := range testcases {
237238 apiClient := & fakeClient {
238- execInspectFunc : func (id string ) (container .ExecInspect , error ) {
239+ execInspectFunc : func (id string ) (client .ExecInspect , error ) {
239240 assert .Check (t , is .Equal (execID , id ))
240- return container .ExecInspect {ExitCode : testcase .exitCode }, testcase .inspectError
241+ return client .ExecInspect {ExitCode : testcase .exitCode }, testcase .inspectError
241242 },
242243 }
243244 err := getExecExitStatus (context .Background (), apiClient , execID )
0 commit comments