@@ -187,7 +187,7 @@ func TestDaemonRestart(t *testing.T) {
187187 t .Fatal (err )
188188 }
189189
190- container , err := client .NewContainer (ctx , id , WithNewSpec (withImageConfig (image ), withProcessArgs ("sleep" , "30" )), withNewSnapshot (id , image ))
190+ container , err := client .NewContainer (ctx , id , WithNewSpec (oci . WithImageConfig (image ), withProcessArgs ("sleep" , "30" )), WithNewSnapshot (id , image ))
191191 if err != nil {
192192 t .Fatal (err )
193193 }
@@ -266,7 +266,7 @@ func TestContainerAttach(t *testing.T) {
266266 t .Fatal (err )
267267 }
268268
269- container , err := client .NewContainer (ctx , id , WithNewSpec (withImageConfig (image ), withCat ()), withNewSnapshot (id , image ))
269+ container , err := client .NewContainer (ctx , id , WithNewSpec (oci . WithImageConfig (image ), withCat ()), WithNewSnapshot (id , image ))
270270 if err != nil {
271271 t .Fatal (err )
272272 }
@@ -427,8 +427,8 @@ func TestContainerUsername(t *testing.T) {
427427
428428 // squid user in the alpine image has a uid of 31
429429 container , err := client .NewContainer (ctx , id ,
430- withNewSnapshot (id , image ),
431- WithNewSpec (withImageConfig (image ), oci .WithUsername ("squid" ), oci .WithProcessArgs ("id" , "-u" )),
430+ WithNewSnapshot (id , image ),
431+ WithNewSpec (oci . WithImageConfig (image ), oci .WithUsername ("squid" ), oci .WithProcessArgs ("id" , "-u" )),
432432 )
433433 if err != nil {
434434 t .Fatal (err )
@@ -487,7 +487,7 @@ func TestContainerAttachProcess(t *testing.T) {
487487 t .Fatal (err )
488488 }
489489
490- container , err := client .NewContainer (ctx , id , WithNewSpec (withImageConfig (image ), withProcessArgs ("sleep" , "100" )), withNewSnapshot (id , image ))
490+ container , err := client .NewContainer (ctx , id , WithNewSpec (oci . WithImageConfig (image ), withProcessArgs ("sleep" , "100" )), WithNewSnapshot (id , image ))
491491 if err != nil {
492492 t .Fatal (err )
493493 }
@@ -620,8 +620,8 @@ func TestContainerUserID(t *testing.T) {
620620
621621 // adm user in the alpine image has a uid of 3 and gid of 4.
622622 container , err := client .NewContainer (ctx , id ,
623- withNewSnapshot (id , image ),
624- WithNewSpec (withImageConfig (image ), oci .WithUserID (3 ), oci .WithProcessArgs ("sh" , "-c" , "echo $(id -u):$(id -g)" )),
623+ WithNewSnapshot (id , image ),
624+ WithNewSpec (oci . WithImageConfig (image ), oci .WithUserID (3 ), oci .WithProcessArgs ("sh" , "-c" , "echo $(id -u):$(id -g)" )),
625625 )
626626 if err != nil {
627627 t .Fatal (err )
@@ -674,8 +674,8 @@ func TestContainerKillAll(t *testing.T) {
674674 }
675675
676676 container , err := client .NewContainer (ctx , id ,
677- withNewSnapshot (id , image ),
678- WithNewSpec (withImageConfig (image ),
677+ WithNewSnapshot (id , image ),
678+ WithNewSpec (oci . WithImageConfig (image ),
679679 withProcessArgs ("sh" , "-c" , "top" ),
680680 oci .WithHostNamespace (specs .PIDNamespace ),
681681 ),
@@ -730,7 +730,7 @@ func TestShimSigkilled(t *testing.T) {
730730 if err != nil {
731731 t .Fatal (err )
732732 }
733- container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image )), withNewSnapshot (id , image ))
733+ container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image )), WithNewSnapshot (id , image ))
734734 if err != nil {
735735 t .Fatal (err )
736736 }
@@ -793,7 +793,7 @@ func TestDaemonRestartWithRunningShim(t *testing.T) {
793793 if err != nil {
794794 t .Fatal (err )
795795 }
796- container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image ), oci .WithProcessArgs ("sleep" , "100" )), withNewSnapshot (id , image ))
796+ container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image ), oci .WithProcessArgs ("sleep" , "100" )), WithNewSnapshot (id , image ))
797797 if err != nil {
798798 t .Fatal (err )
799799 }
@@ -877,8 +877,8 @@ func TestContainerRuntimeOptions(t *testing.T) {
877877
878878 container , err := client .NewContainer (
879879 ctx , id ,
880- WithNewSpec (withImageConfig (image ), withExitStatus (7 )),
881- withNewSnapshot (id , image ),
880+ WithNewSpec (oci . WithImageConfig (image ), withExitStatus (7 )),
881+ WithNewSnapshot (id , image ),
882882 WithRuntime ("io.containerd.runtime.v1.linux" , & runctypes.RuncOptions {Runtime : "no-runc" }),
883883 )
884884 if err != nil {
@@ -917,8 +917,8 @@ func TestContainerKillInitPidHost(t *testing.T) {
917917 }
918918
919919 container , err := client .NewContainer (ctx , id ,
920- withNewSnapshot (id , image ),
921- WithNewSpec (withImageConfig (image ),
920+ WithNewSnapshot (id , image ),
921+ WithNewSpec (oci . WithImageConfig (image ),
922922 withProcessArgs ("sh" , "-c" , "sleep 42; echo hi" ),
923923 oci .WithHostNamespace (specs .PIDNamespace ),
924924 ),
@@ -1007,7 +1007,7 @@ func testUserNamespaces(t *testing.T, readonlyRootFS bool) {
10071007 t .Fatal (err )
10081008 }
10091009
1010- opts := []NewContainerOpts {WithNewSpec (withImageConfig (image ),
1010+ opts := []NewContainerOpts {WithNewSpec (oci . WithImageConfig (image ),
10111011 withExitStatus (7 ),
10121012 oci .WithUserNamespace (0 , 1000 , 10000 ),
10131013 )}
@@ -1081,13 +1081,11 @@ func TestTaskResize(t *testing.T) {
10811081 )
10821082 defer cancel ()
10831083
1084- if runtime .GOOS != "windows" {
1085- image , err = client .GetImage (ctx , testImage )
1086- if err != nil {
1087- t .Fatal (err )
1088- }
1084+ image , err = client .GetImage (ctx , testImage )
1085+ if err != nil {
1086+ t .Fatal (err )
10891087 }
1090- container , err := client .NewContainer (ctx , id , WithNewSpec (withImageConfig (image ), withExitStatus (7 )), withNewSnapshot (id , image ))
1088+ container , err := client .NewContainer (ctx , id , WithNewSpec (oci . WithImageConfig (image ), withExitStatus (7 )), WithNewSnapshot (id , image ))
10911089 if err != nil {
10921090 t .Fatal (err )
10931091 }
0 commit comments