88 "testing"
99 "time"
1010
11- "github.com/docker/docker/api/types"
1211 "github.com/docker/docker/api/types/container"
13- containertypes "github.com/docker/docker/api/types/container"
1412 "github.com/docker/docker/api/types/network"
1513 "github.com/docker/docker/api/types/versions"
1614 "github.com/docker/docker/client"
@@ -253,7 +251,7 @@ func TestCreateWithCustomMaskedPaths(t *testing.T) {
253251 checkInspect (t , ctx , name , tc .expected )
254252
255253 // Start the container.
256- err = apiClient .ContainerStart (ctx , c .ID , types. ContainerStartOptions {})
254+ err = apiClient .ContainerStart (ctx , c .ID , container. StartOptions {})
257255 assert .NilError (t , err )
258256
259257 poll .WaitOn (t , ctr .IsInState (ctx , apiClient , c .ID , "exited" ), poll .WithDelay (100 * time .Millisecond ))
@@ -331,7 +329,7 @@ func TestCreateWithCustomReadonlyPaths(t *testing.T) {
331329 checkInspect (t , ctx , name , tc .expected )
332330
333331 // Start the container.
334- err = apiClient .ContainerStart (ctx , c .ID , types. ContainerStartOptions {})
332+ err = apiClient .ContainerStart (ctx , c .ID , container. StartOptions {})
335333 assert .NilError (t , err )
336334
337335 poll .WaitOn (t , ctr .IsInState (ctx , apiClient , c .ID , "exited" ), poll .WithDelay (100 * time .Millisecond ))
@@ -436,7 +434,7 @@ func TestCreateTmpfsOverrideAnonymousVolume(t *testing.T) {
436434 )
437435
438436 defer func () {
439- err := apiClient .ContainerRemove (ctx , id , containertypes .RemoveOptions {Force : true })
437+ err := apiClient .ContainerRemove (ctx , id , container .RemoveOptions {Force : true })
440438 assert .NilError (t , err )
441439 }()
442440
@@ -447,7 +445,7 @@ func TestCreateTmpfsOverrideAnonymousVolume(t *testing.T) {
447445 assert .Assert (t , is .Len (inspect .Mounts , 0 ))
448446
449447 chWait , chErr := apiClient .ContainerWait (ctx , id , container .WaitConditionNextExit )
450- assert .NilError (t , apiClient .ContainerStart (ctx , id , types. ContainerStartOptions {}))
448+ assert .NilError (t , apiClient .ContainerStart (ctx , id , container. StartOptions {}))
451449
452450 timeout := time .NewTimer (30 * time .Second )
453451 defer timeout .Stop ()
@@ -483,7 +481,7 @@ func TestCreateDifferentPlatform(t *testing.T) {
483481 Architecture : img .Architecture ,
484482 Variant : img .Variant ,
485483 }
486- _ , err := apiClient .ContainerCreate (ctx , & containertypes .Config {Image : "busybox:latest" }, & containertypes .HostConfig {}, nil , & p , "" )
484+ _ , err := apiClient .ContainerCreate (ctx , & container .Config {Image : "busybox:latest" }, & container .HostConfig {}, nil , & p , "" )
487485 assert .Check (t , is .ErrorType (err , errdefs .IsNotFound ))
488486 })
489487 t .Run ("different cpu arch" , func (t * testing.T ) {
@@ -493,7 +491,7 @@ func TestCreateDifferentPlatform(t *testing.T) {
493491 Architecture : img .Architecture + "DifferentArch" ,
494492 Variant : img .Variant ,
495493 }
496- _ , err := apiClient .ContainerCreate (ctx , & containertypes .Config {Image : "busybox:latest" }, & containertypes .HostConfig {}, nil , & p , "" )
494+ _ , err := apiClient .ContainerCreate (ctx , & container .Config {Image : "busybox:latest" }, & container .HostConfig {}, nil , & p , "" )
497495 assert .Check (t , is .ErrorType (err , errdefs .IsNotFound ))
498496 })
499497}
@@ -541,32 +539,32 @@ func TestCreateInvalidHostConfig(t *testing.T) {
541539
542540 testCases := []struct {
543541 doc string
544- hc containertypes .HostConfig
542+ hc container .HostConfig
545543 expectedErr string
546544 }{
547545 {
548546 doc : "invalid IpcMode" ,
549- hc : containertypes .HostConfig {IpcMode : "invalid" },
547+ hc : container .HostConfig {IpcMode : "invalid" },
550548 expectedErr : "Error response from daemon: invalid IPC mode: invalid" ,
551549 },
552550 {
553551 doc : "invalid PidMode" ,
554- hc : containertypes .HostConfig {PidMode : "invalid" },
552+ hc : container .HostConfig {PidMode : "invalid" },
555553 expectedErr : "Error response from daemon: invalid PID mode: invalid" ,
556554 },
557555 {
558556 doc : "invalid PidMode without container ID" ,
559- hc : containertypes .HostConfig {PidMode : "container" },
557+ hc : container .HostConfig {PidMode : "container" },
560558 expectedErr : "Error response from daemon: invalid PID mode: container" ,
561559 },
562560 {
563561 doc : "invalid UTSMode" ,
564- hc : containertypes .HostConfig {UTSMode : "invalid" },
562+ hc : container .HostConfig {UTSMode : "invalid" },
565563 expectedErr : "Error response from daemon: invalid UTS mode: invalid" ,
566564 },
567565 {
568566 doc : "invalid Annotations" ,
569- hc : containertypes .HostConfig {Annotations : map [string ]string {"" : "a" }},
567+ hc : container .HostConfig {Annotations : map [string ]string {"" : "a" }},
570568 expectedErr : "Error response from daemon: invalid Annotations: the empty string is not permitted as an annotation key" ,
571569 },
572570 }
0 commit comments