@@ -119,7 +119,7 @@ func TestContainerStart(t *testing.T) {
119119 if err != nil {
120120 t .Fatal (err )
121121 }
122- container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image ), withExitStatus (7 )), WithNewSnapshot ( id , image ))
122+ container , err := client .NewContainer (ctx , id , WithNewSnapshot ( id , image ), WithNewSpec (oci .WithImageConfig (image ), withExitStatus (7 )))
123123 if err != nil {
124124 t .Fatal (err )
125125 }
@@ -183,7 +183,7 @@ func TestContainerOutput(t *testing.T) {
183183 if err != nil {
184184 t .Fatal (err )
185185 }
186- container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("echo" , expected )), WithNewSnapshot ( id , image ))
186+ container , err := client .NewContainer (ctx , id , WithNewSnapshot ( id , image ), WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("echo" , expected )))
187187 if err != nil {
188188 t .Fatal (err )
189189 }
@@ -252,7 +252,7 @@ func TestContainerExec(t *testing.T) {
252252 t .Fatal (err )
253253 }
254254
255- container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("sleep" , "100" )), WithNewSnapshot ( id , image ))
255+ container , err := client .NewContainer (ctx , id , WithNewSnapshot ( id , image ), WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("sleep" , "100" )))
256256 if err != nil {
257257 t .Fatal (err )
258258 }
@@ -337,7 +337,7 @@ func TestContainerLargeExecArgs(t *testing.T) {
337337 t .Fatal (err )
338338 }
339339
340- container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("sleep" , "100" )), WithNewSnapshot ( id , image ))
340+ container , err := client .NewContainer (ctx , id , WithNewSnapshot ( id , image ), WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("sleep" , "100" )))
341341 if err != nil {
342342 t .Fatal (err )
343343 }
@@ -413,7 +413,7 @@ func TestContainerPids(t *testing.T) {
413413 t .Fatal (err )
414414 }
415415
416- container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("sleep" , "100" )), WithNewSnapshot ( id , image ))
416+ container , err := client .NewContainer (ctx , id , WithNewSnapshot ( id , image ), WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("sleep" , "100" )))
417417 if err != nil {
418418 t .Fatal (err )
419419 }
@@ -490,7 +490,7 @@ func TestContainerCloseIO(t *testing.T) {
490490 t .Fatal (err )
491491 }
492492
493- container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image ), withCat ()), WithNewSnapshot ( id , image ))
493+ container , err := client .NewContainer (ctx , id , WithNewSnapshot ( id , image ), WithNewSpec (oci .WithImageConfig (image ), withCat ()))
494494 if err != nil {
495495 t .Fatal (err )
496496 }
@@ -546,7 +546,7 @@ func TestDeleteRunningContainer(t *testing.T) {
546546 t .Fatal (err )
547547 }
548548
549- container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("sleep" , "100" )), WithNewSnapshot ( id , image ))
549+ container , err := client .NewContainer (ctx , id , WithNewSnapshot ( id , image ), WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("sleep" , "100" )))
550550 if err != nil {
551551 t .Fatal (err )
552552 }
@@ -601,7 +601,7 @@ func TestContainerKill(t *testing.T) {
601601 t .Fatal (err )
602602 }
603603
604- container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("sleep" , "10" )), WithNewSnapshot ( id , image ))
604+ container , err := client .NewContainer (ctx , id , WithNewSnapshot ( id , image ), WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("sleep" , "10" )))
605605 if err != nil {
606606 t .Fatal (err )
607607 }
@@ -657,8 +657,8 @@ func TestContainerNoBinaryExists(t *testing.T) {
657657 }
658658
659659 container , err := client .NewContainer (ctx , id ,
660- WithNewSpec ( oci . WithImageConfig ( image ), oci . WithProcessArgs ( "nothing" ) ),
661- WithNewSnapshot ( id , image ))
660+ WithNewSnapshot ( id , image ),
661+ WithNewSpec ( oci . WithImageConfig ( image ), oci . WithProcessArgs ( "nothing" ) ))
662662 if err != nil {
663663 t .Fatal (err )
664664 }
@@ -703,7 +703,7 @@ func TestContainerExecNoBinaryExists(t *testing.T) {
703703 t .Fatal (err )
704704 }
705705
706- container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("sleep" , "100" )), WithNewSnapshot ( id , image ))
706+ container , err := client .NewContainer (ctx , id , WithNewSnapshot ( id , image ), WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("sleep" , "100" )))
707707 if err != nil {
708708 t .Fatal (err )
709709 }
@@ -768,7 +768,7 @@ func TestWaitStoppedTask(t *testing.T) {
768768 t .Fatal (err )
769769 }
770770
771- container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image ), withExitStatus (7 )), WithNewSnapshot ( id , image ))
771+ container , err := client .NewContainer (ctx , id , WithNewSnapshot ( id , image ), WithNewSpec (oci .WithImageConfig (image ), withExitStatus (7 )))
772772 if err != nil {
773773 t .Fatal (err )
774774 }
@@ -831,7 +831,7 @@ func TestWaitStoppedProcess(t *testing.T) {
831831 t .Fatal (err )
832832 }
833833
834- container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("sleep" , "100" )), WithNewSnapshot ( id , image ))
834+ container , err := client .NewContainer (ctx , id , WithNewSnapshot ( id , image ), WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("sleep" , "100" )))
835835 if err != nil {
836836 t .Fatal (err )
837837 }
@@ -918,7 +918,7 @@ func TestTaskForceDelete(t *testing.T) {
918918 if err != nil {
919919 t .Fatal (err )
920920 }
921- container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("sleep" , "30" )), WithNewSnapshot ( id , image ))
921+ container , err := client .NewContainer (ctx , id , WithNewSnapshot ( id , image ), WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("sleep" , "30" )))
922922 if err != nil {
923923 t .Fatal (err )
924924 }
@@ -959,7 +959,7 @@ func TestProcessForceDelete(t *testing.T) {
959959 if err != nil {
960960 t .Fatal (err )
961961 }
962- container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("sleep" , "30" )), WithNewSnapshot ( id , image ))
962+ container , err := client .NewContainer (ctx , id , WithNewSnapshot ( id , image ), WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("sleep" , "30" )))
963963 if err != nil {
964964 t .Fatal (err )
965965 }
@@ -1029,11 +1029,10 @@ func TestContainerHostname(t *testing.T) {
10291029 t .Fatal (err )
10301030 }
10311031
1032- container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image ),
1032+ container , err := client .NewContainer (ctx , id , WithNewSnapshot ( id , image ), WithNewSpec (oci .WithImageConfig (image ),
10331033 withProcessArgs ("hostname" ),
10341034 oci .WithHostname (expected ),
1035- ),
1036- WithNewSnapshot (id , image ))
1035+ ))
10371036 if err != nil {
10381037 t .Fatal (err )
10391038 }
@@ -1098,7 +1097,7 @@ func TestContainerExitedAtSet(t *testing.T) {
10981097 t .Fatal (err )
10991098 }
11001099
1101- container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image ), withTrue ()), WithNewSnapshot ( id , image ))
1100+ container , err := client .NewContainer (ctx , id , WithNewSnapshot ( id , image ), WithNewSpec (oci .WithImageConfig (image ), withTrue ()))
11021101 if err != nil {
11031102 t .Fatal (err )
11041103 }
@@ -1158,7 +1157,7 @@ func TestDeleteContainerExecCreated(t *testing.T) {
11581157 t .Fatal (err )
11591158 }
11601159
1161- container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("sleep" , "100" )), WithNewSnapshot ( id , image ))
1160+ container , err := client .NewContainer (ctx , id , WithNewSnapshot ( id , image ), WithNewSpec (oci .WithImageConfig (image ), withProcessArgs ("sleep" , "100" )))
11621161 if err != nil {
11631162 t .Fatal (err )
11641163 }
@@ -1228,8 +1227,8 @@ func TestContainerMetrics(t *testing.T) {
12281227 t .Fatal (err )
12291228 }
12301229 container , err := client .NewContainer (ctx , id ,
1231- WithNewSpec ( oci . WithImageConfig ( image ), oci . WithProcessArgs ( "sleep" , "30" ) ),
1232- WithNewSnapshot ( id , image ))
1230+ WithNewSnapshot ( id , image ),
1231+ WithNewSpec ( oci . WithImageConfig ( image ), oci . WithProcessArgs ( "sleep" , "30" ) ))
12331232 if err != nil {
12341233 t .Fatal (err )
12351234 }
@@ -1285,9 +1284,8 @@ func TestDeletedContainerMetrics(t *testing.T) {
12851284 t .Fatal (err )
12861285 }
12871286 container , err := client .NewContainer (ctx , id ,
1288- WithNewSpec (oci .WithImageConfig (image ), withExitStatus (0 )),
12891287 WithNewSnapshot (id , image ),
1290- )
1288+ WithNewSpec ( oci . WithImageConfig ( image ), withExitStatus ( 0 )) )
12911289 if err != nil {
12921290 t .Fatal (err )
12931291 }
@@ -1518,7 +1516,7 @@ func TestContainerHook(t *testing.T) {
15181516 }
15191517 return nil
15201518 }
1521- container , err := client .NewContainer (ctx , id , WithNewSpec (oci .WithImageConfig (image ), hook ), WithNewSnapshot ( id , image ))
1519+ container , err := client .NewContainer (ctx , id , WithNewSnapshot ( id , image ), WithNewSpec (oci .WithImageConfig (image ), hook ))
15221520 if err != nil {
15231521 t .Fatal (err )
15241522 }
0 commit comments