@@ -255,7 +255,7 @@ func TestContainerCapabilities(t *testing.T) {
255255 c .allCaps = allCaps
256256
257257 containerConfig .Linux .SecurityContext .Capabilities = test .capability
258- spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime )
258+ spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime , nil )
259259 require .NoError (t , err )
260260
261261 if selinux .GetEnabled () {
@@ -290,7 +290,7 @@ func TestContainerSpecTty(t *testing.T) {
290290 c := newTestCRIService ()
291291 for _ , tty := range []bool {true , false } {
292292 containerConfig .Tty = tty
293- spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime )
293+ spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime , nil )
294294 require .NoError (t , err )
295295 specCheck (t , testID , testSandboxID , testPid , spec )
296296 assert .Equal (t , tty , spec .Process .Terminal )
@@ -317,7 +317,7 @@ func TestContainerSpecDefaultPath(t *testing.T) {
317317 imageConfig .Env = append (imageConfig .Env , pathenv )
318318 expected = pathenv
319319 }
320- spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime )
320+ spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime , nil )
321321 require .NoError (t , err )
322322 specCheck (t , testID , testSandboxID , testPid , spec )
323323 assert .Contains (t , spec .Process .Env , expected )
@@ -334,7 +334,7 @@ func TestContainerSpecReadonlyRootfs(t *testing.T) {
334334 c := newTestCRIService ()
335335 for _ , readonly := range []bool {true , false } {
336336 containerConfig .Linux .SecurityContext .ReadonlyRootfs = readonly
337- spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime )
337+ spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime , nil )
338338 require .NoError (t , err )
339339 specCheck (t , testID , testSandboxID , testPid , spec )
340340 assert .Equal (t , readonly , spec .Root .Readonly )
@@ -368,7 +368,7 @@ func TestContainerSpecWithExtraMounts(t *testing.T) {
368368 Readonly : false ,
369369 },
370370 }
371- spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , extraMounts , ociRuntime )
371+ spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , extraMounts , ociRuntime , nil )
372372 require .NoError (t , err )
373373 specCheck (t , testID , testSandboxID , testPid , spec )
374374 var mounts , sysMounts []runtimespec.Mount
@@ -435,7 +435,7 @@ func TestContainerAndSandboxPrivileged(t *testing.T) {
435435 sandboxConfig .Linux .SecurityContext = & runtime.LinuxSandboxSecurityContext {
436436 Privileged : test .sandboxPrivileged ,
437437 }
438- _ , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime )
438+ _ , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime , nil )
439439 if test .expectError {
440440 assert .Error (t , err )
441441 } else {
@@ -476,7 +476,7 @@ func TestPrivilegedBindMount(t *testing.T) {
476476 containerConfig .Linux .SecurityContext .Privileged = test .privileged
477477 sandboxConfig .Linux .SecurityContext .Privileged = test .privileged
478478
479- spec , err := c .buildContainerSpec (currentPlatform , t .Name (), testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime )
479+ spec , err := c .buildContainerSpec (currentPlatform , t .Name (), testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime , nil )
480480
481481 assert .NoError (t , err )
482482 if test .expectedSysFSRO {
@@ -597,7 +597,7 @@ func TestMountPropagation(t *testing.T) {
597597 var spec runtimespec.Spec
598598 spec .Linux = & runtimespec.Linux {}
599599
600- err := opts .WithMounts (c .os , config , []* runtime.Mount {test .criMount }, "" )(context .Background (), nil , nil , & spec )
600+ err := opts .WithMounts (c .os , config , []* runtime.Mount {test .criMount }, "" , nil )(context .Background (), nil , nil , & spec )
601601 if test .expectErr {
602602 require .Error (t , err )
603603 } else {
@@ -648,7 +648,7 @@ func TestPidNamespace(t *testing.T) {
648648 test := test
649649 t .Run (test .desc , func (t * testing.T ) {
650650 containerConfig .Linux .SecurityContext .NamespaceOptions = & runtime.NamespaceOption {Pid : test .pidNS }
651- spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime )
651+ spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime , nil )
652652 require .NoError (t , err )
653653 assert .Contains (t , spec .Linux .Namespaces , test .expected )
654654 })
@@ -823,7 +823,7 @@ func TestUserNamespace(t *testing.T) {
823823 sandboxUserns = test .sandboxUserNS
824824 }
825825 sandboxConfig .Linux .SecurityContext .NamespaceOptions = & runtime.NamespaceOption {UsernsOptions : sandboxUserns }
826- spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime )
826+ spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime , nil )
827827
828828 if test .err {
829829 require .Error (t , err )
@@ -853,7 +853,7 @@ func TestNoDefaultRunMount(t *testing.T) {
853853 ociRuntime := config.Runtime {}
854854 c := newTestCRIService ()
855855
856- spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime )
856+ spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime , nil )
857857 assert .NoError (t , err )
858858 for _ , mount := range spec .Mounts {
859859 assert .NotEqual (t , "/run" , mount .Destination )
@@ -1282,7 +1282,7 @@ func TestMaskedAndReadonlyPaths(t *testing.T) {
12821282 sandboxConfig .Linux .SecurityContext = & runtime.LinuxSandboxSecurityContext {
12831283 Privileged : test .privileged ,
12841284 }
1285- spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime )
1285+ spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime , nil )
12861286 require .NoError (t , err )
12871287 if ! test .privileged { // specCheck presumes an unprivileged container
12881288 specCheck (t , testID , testSandboxID , testPid , spec )
@@ -1335,7 +1335,7 @@ func TestHostname(t *testing.T) {
13351335 sandboxConfig .Linux .SecurityContext = & runtime.LinuxSandboxSecurityContext {
13361336 NamespaceOptions : & runtime.NamespaceOption {Network : test .networkNs },
13371337 }
1338- spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime )
1338+ spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime , nil )
13391339 require .NoError (t , err )
13401340 specCheck (t , testID , testSandboxID , testPid , spec )
13411341 assert .Contains (t , spec .Process .Env , test .expectedEnv )
@@ -1348,7 +1348,7 @@ func TestDisableCgroup(t *testing.T) {
13481348 ociRuntime := config.Runtime {}
13491349 c := newTestCRIService ()
13501350 c .config .DisableCgroup = true
1351- spec , err := c .buildContainerSpec (currentPlatform , "test-id" , "sandbox-id" , 1234 , "" , "container-name" , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime )
1351+ spec , err := c .buildContainerSpec (currentPlatform , "test-id" , "sandbox-id" , 1234 , "" , "container-name" , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime , nil )
13521352 require .NoError (t , err )
13531353
13541354 t .Log ("resource limit should not be set" )
@@ -1503,7 +1503,7 @@ additional-group-for-root:x:22222:root
15031503 containerConfig .Linux .SecurityContext = test .securityContext
15041504 imageConfig .User = test .imageConfigUser
15051505
1506- spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime )
1506+ spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime , nil )
15071507 require .NoError (t , err )
15081508
15091509 spec .Root .Path = tempRootDir // simulating /etc/{passwd, group}
@@ -1579,7 +1579,7 @@ func TestNonRootUserAndDevices(t *testing.T) {
15791579 },
15801580 }
15811581
1582- spec , err := c .buildContainerSpec (currentPlatform , t .Name (), testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , config.Runtime {})
1582+ spec , err := c .buildContainerSpec (currentPlatform , t .Name (), testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , config.Runtime {}, nil )
15831583 assert .NoError (t , err )
15841584
15851585 assert .Equal (t , test .expectedDeviceUID , * spec .Linux .Devices [0 ].UID )
@@ -1653,7 +1653,7 @@ func TestPrivilegedDevices(t *testing.T) {
16531653 PrivilegedWithoutHostDevices : test .privilegedWithoutHostDevices ,
16541654 PrivilegedWithoutHostDevicesAllDevicesAllowed : test .privilegedWithoutHostDevicesAllDevicesAllowed ,
16551655 }
1656- spec , err := c .buildContainerSpec (currentPlatform , t .Name (), testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime )
1656+ spec , err := c .buildContainerSpec (currentPlatform , t .Name (), testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime , nil )
16571657 assert .NoError (t , err )
16581658
16591659 hostDevicesRaw , err := oci .HostDevices ()
@@ -1708,7 +1708,7 @@ func TestBaseOCISpec(t *testing.T) {
17081708 testPid := uint32 (1234 )
17091709 containerConfig , sandboxConfig , imageConfig , specCheck := getCreateContainerTestData ()
17101710
1711- spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime )
1711+ spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime , nil )
17121712 assert .NoError (t , err )
17131713
17141714 specCheck (t , testID , testSandboxID , testPid , spec )
@@ -2040,7 +2040,7 @@ containerEdits:
20402040 },
20412041 } {
20422042 t .Run (test .description , func (t * testing.T ) {
2043- spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime )
2043+ spec , err := c .buildContainerSpec (currentPlatform , testID , testSandboxID , testPid , "" , testContainerName , testImageName , containerConfig , sandboxConfig , imageConfig , nil , ociRuntime , nil )
20442044 require .NoError (t , err )
20452045
20462046 specCheck (t , testID , testSandboxID , testPid , spec )
0 commit comments