@@ -450,19 +450,22 @@ func TestContainerMounts(t *testing.T) {
450450 },
451451 expectedMounts : []* runtime.Mount {
452452 {
453- ContainerPath : "/etc/hostname" ,
454- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hostname" ),
455- Readonly : true ,
453+ ContainerPath : "/etc/hostname" ,
454+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hostname" ),
455+ Readonly : true ,
456+ SelinuxRelabel : true ,
456457 },
457458 {
458- ContainerPath : "/etc/hosts" ,
459- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hosts" ),
460- Readonly : true ,
459+ ContainerPath : "/etc/hosts" ,
460+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hosts" ),
461+ Readonly : true ,
462+ SelinuxRelabel : true ,
461463 },
462464 {
463- ContainerPath : resolvConfPath ,
464- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "resolv.conf" ),
465- Readonly : true ,
465+ ContainerPath : resolvConfPath ,
466+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "resolv.conf" ),
467+ Readonly : true ,
468+ SelinuxRelabel : true ,
466469 },
467470 {
468471 ContainerPath : "/dev/shm" ,
@@ -476,19 +479,22 @@ func TestContainerMounts(t *testing.T) {
476479 securityContext : & runtime.LinuxContainerSecurityContext {},
477480 expectedMounts : []* runtime.Mount {
478481 {
479- ContainerPath : "/etc/hostname" ,
480- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hostname" ),
481- Readonly : false ,
482+ ContainerPath : "/etc/hostname" ,
483+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hostname" ),
484+ Readonly : false ,
485+ SelinuxRelabel : true ,
482486 },
483487 {
484- ContainerPath : "/etc/hosts" ,
485- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hosts" ),
486- Readonly : false ,
488+ ContainerPath : "/etc/hosts" ,
489+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hosts" ),
490+ Readonly : false ,
491+ SelinuxRelabel : true ,
487492 },
488493 {
489- ContainerPath : resolvConfPath ,
490- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "resolv.conf" ),
491- Readonly : false ,
494+ ContainerPath : resolvConfPath ,
495+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "resolv.conf" ),
496+ Readonly : false ,
497+ SelinuxRelabel : true ,
492498 },
493499 {
494500 ContainerPath : "/dev/shm" ,
@@ -504,19 +510,22 @@ func TestContainerMounts(t *testing.T) {
504510 },
505511 expectedMounts : []* runtime.Mount {
506512 {
507- ContainerPath : "/etc/hostname" ,
508- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hostname" ),
509- Readonly : false ,
513+ ContainerPath : "/etc/hostname" ,
514+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hostname" ),
515+ Readonly : false ,
516+ SelinuxRelabel : true ,
510517 },
511518 {
512- ContainerPath : "/etc/hosts" ,
513- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hosts" ),
514- Readonly : false ,
519+ ContainerPath : "/etc/hosts" ,
520+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hosts" ),
521+ Readonly : false ,
522+ SelinuxRelabel : true ,
515523 },
516524 {
517- ContainerPath : resolvConfPath ,
518- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "resolv.conf" ),
519- Readonly : false ,
525+ ContainerPath : resolvConfPath ,
526+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "resolv.conf" ),
527+ Readonly : false ,
528+ SelinuxRelabel : true ,
520529 },
521530 {
522531 ContainerPath : "/dev/shm" ,
@@ -555,14 +564,16 @@ func TestContainerMounts(t *testing.T) {
555564 securityContext : & runtime.LinuxContainerSecurityContext {},
556565 expectedMounts : []* runtime.Mount {
557566 {
558- ContainerPath : "/etc/hosts" ,
559- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hosts" ),
560- Readonly : false ,
567+ ContainerPath : "/etc/hosts" ,
568+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hosts" ),
569+ Readonly : false ,
570+ SelinuxRelabel : true ,
561571 },
562572 {
563- ContainerPath : resolvConfPath ,
564- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "resolv.conf" ),
565- Readonly : false ,
573+ ContainerPath : resolvConfPath ,
574+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "resolv.conf" ),
575+ Readonly : false ,
576+ SelinuxRelabel : true ,
566577 },
567578 {
568579 ContainerPath : "/dev/shm" ,
0 commit comments