@@ -183,7 +183,7 @@ devices:
183183 }
184184 }
185185
186- cache , err = NewCache (WithSpecDirs (
186+ cache = NewCache (WithSpecDirs (
187187 filepath .Join (dir , "etc" ),
188188 filepath .Join (dir , "run" )),
189189 )
@@ -196,9 +196,6 @@ devices:
196196 }
197197 }
198198
199- if len (tc .errors ) == 0 {
200- require .Nil (t , err )
201- }
202199 require .NotNil (t , cache )
203200
204201 for name , dev := range cache .devices {
@@ -557,8 +554,7 @@ devices:
557554 if ! selfRefresh {
558555 opts = append (opts , WithAutoRefresh (false ))
559556 }
560- cache , err = NewCache (opts ... )
561- require .NoError (t , err )
557+ cache = NewCache (opts ... )
562558 require .NotNil (t , cache )
563559 } else {
564560 err = updateSpecDirs (t , dir , update .etc , update .run )
@@ -789,13 +785,12 @@ devices:
789785 dir , err = createSpecDirs (t , tc .updates [0 ].etc , tc .updates [0 ].run )
790786 require .NoError (t , err )
791787
792- cache , err = NewCache (
788+ cache = NewCache (
793789 WithSpecDirs (
794790 filepath .Join (dir , "etc" ),
795791 filepath .Join (dir , "run" ),
796792 ),
797793 )
798- require .NoError (t , err )
799794 require .NotNil (t , cache )
800795
801796 go injector ()
@@ -1176,13 +1171,12 @@ devices:
11761171 t .Errorf ("failed to create test directory: %v" , err )
11771172 return
11781173 }
1179- cache , err = NewCache (
1174+ cache = NewCache (
11801175 WithSpecDirs (
11811176 filepath .Join (dir , "etc" ),
11821177 filepath .Join (dir , "run" ),
11831178 ),
11841179 )
1185- require .Nil (t , err )
11861180 require .NotNil (t , cache )
11871181
11881182 unresolved , err := cache .InjectDevices (tc .ociSpec , tc .devices ... )
@@ -1415,13 +1409,12 @@ devices:
14151409 t .Errorf ("failed to create test directory: %v" , err )
14161410 return
14171411 }
1418- cache , err = NewCache (
1412+ cache = NewCache (
14191413 WithSpecDirs (
14201414 filepath .Join (dir , "etc" ),
14211415 filepath .Join (dir , "run" ),
14221416 ),
14231417 )
1424- require .Nil (t , err )
14251418 require .NotNil (t , cache )
14261419
14271420 vendors := cache .ListVendors ()
@@ -1571,15 +1564,14 @@ containerEdits:
15711564 if len (tc .invalid ) != 0 {
15721565 dir , err = createSpecDirs (t , nil , nil )
15731566 require .NoError (t , err )
1574- cache , err = NewCache (
1567+ cache = NewCache (
15751568 WithSpecDirs (
15761569 filepath .Join (dir , "etc" ),
15771570 filepath .Join (dir , "run" ),
15781571 ),
15791572 WithAutoRefresh (false ),
15801573 )
15811574
1582- require .NoError (t , err )
15831575 require .NotNil (t , cache )
15841576
15851577 etc = map [string ]string {}
@@ -1604,21 +1596,19 @@ containerEdits:
16041596 dir , err = createSpecDirs (t , etc , nil )
16051597 require .NoError (t , err )
16061598
1607- cache , err = NewCache (
1599+ cache = NewCache (
16081600 WithSpecDirs (
16091601 filepath .Join (dir , "etc" ),
16101602 ),
16111603 )
1612- require .NoError (t , err )
16131604 require .NotNil (t , cache )
16141605
1615- other , err = NewCache (
1606+ other = NewCache (
16161607 WithSpecDirs (
16171608 filepath .Join (dir , "run" ),
16181609 ),
16191610 WithAutoRefresh (false ),
16201611 )
1621- require .NoError (t , err )
16221612 require .NotNil (t , other )
16231613
16241614 cSpecs := map [string ]* cdi.Spec {}
@@ -1796,15 +1786,14 @@ devices:
17961786
17971787 dir , err = createSpecDirs (t , nil , nil )
17981788 require .NoError (t , err )
1799- cache , err = NewCache (
1789+ cache = NewCache (
18001790 WithSpecDirs (
18011791 filepath .Join (dir , "etc" ),
18021792 filepath .Join (dir , "run" ),
18031793 ),
18041794 WithAutoRefresh (false ),
18051795 )
18061796
1807- require .NoError (t , err )
18081797 require .NotNil (t , cache )
18091798
18101799 for idx , data := range tc .specs {
0 commit comments