@@ -452,19 +452,22 @@ func TestContainerMounts(t *testing.T) {
452452 },
453453 expectedMounts : []* runtime.Mount {
454454 {
455- ContainerPath : "/etc/hostname" ,
456- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hostname" ),
457- Readonly : true ,
455+ ContainerPath : "/etc/hostname" ,
456+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hostname" ),
457+ Readonly : true ,
458+ SelinuxRelabel : true ,
458459 },
459460 {
460- ContainerPath : "/etc/hosts" ,
461- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hosts" ),
462- Readonly : true ,
461+ ContainerPath : "/etc/hosts" ,
462+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hosts" ),
463+ Readonly : true ,
464+ SelinuxRelabel : true ,
463465 },
464466 {
465- ContainerPath : resolvConfPath ,
466- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "resolv.conf" ),
467- Readonly : true ,
467+ ContainerPath : resolvConfPath ,
468+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "resolv.conf" ),
469+ Readonly : true ,
470+ SelinuxRelabel : true ,
468471 },
469472 {
470473 ContainerPath : "/dev/shm" ,
@@ -478,19 +481,22 @@ func TestContainerMounts(t *testing.T) {
478481 securityContext : & runtime.LinuxContainerSecurityContext {},
479482 expectedMounts : []* runtime.Mount {
480483 {
481- ContainerPath : "/etc/hostname" ,
482- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hostname" ),
483- Readonly : false ,
484+ ContainerPath : "/etc/hostname" ,
485+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hostname" ),
486+ Readonly : false ,
487+ SelinuxRelabel : true ,
484488 },
485489 {
486- ContainerPath : "/etc/hosts" ,
487- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hosts" ),
488- Readonly : false ,
490+ ContainerPath : "/etc/hosts" ,
491+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hosts" ),
492+ Readonly : false ,
493+ SelinuxRelabel : true ,
489494 },
490495 {
491- ContainerPath : resolvConfPath ,
492- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "resolv.conf" ),
493- Readonly : false ,
496+ ContainerPath : resolvConfPath ,
497+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "resolv.conf" ),
498+ Readonly : false ,
499+ SelinuxRelabel : true ,
494500 },
495501 {
496502 ContainerPath : "/dev/shm" ,
@@ -506,19 +512,22 @@ func TestContainerMounts(t *testing.T) {
506512 },
507513 expectedMounts : []* runtime.Mount {
508514 {
509- ContainerPath : "/etc/hostname" ,
510- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hostname" ),
511- Readonly : false ,
515+ ContainerPath : "/etc/hostname" ,
516+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hostname" ),
517+ Readonly : false ,
518+ SelinuxRelabel : true ,
512519 },
513520 {
514- ContainerPath : "/etc/hosts" ,
515- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hosts" ),
516- Readonly : false ,
521+ ContainerPath : "/etc/hosts" ,
522+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hosts" ),
523+ Readonly : false ,
524+ SelinuxRelabel : true ,
517525 },
518526 {
519- ContainerPath : resolvConfPath ,
520- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "resolv.conf" ),
521- Readonly : false ,
527+ ContainerPath : resolvConfPath ,
528+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "resolv.conf" ),
529+ Readonly : false ,
530+ SelinuxRelabel : true ,
522531 },
523532 {
524533 ContainerPath : "/dev/shm" ,
@@ -557,14 +566,16 @@ func TestContainerMounts(t *testing.T) {
557566 securityContext : & runtime.LinuxContainerSecurityContext {},
558567 expectedMounts : []* runtime.Mount {
559568 {
560- ContainerPath : "/etc/hosts" ,
561- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hosts" ),
562- Readonly : false ,
569+ ContainerPath : "/etc/hosts" ,
570+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "hosts" ),
571+ Readonly : false ,
572+ SelinuxRelabel : true ,
563573 },
564574 {
565- ContainerPath : resolvConfPath ,
566- HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "resolv.conf" ),
567- Readonly : false ,
575+ ContainerPath : resolvConfPath ,
576+ HostPath : filepath .Join (testRootDir , sandboxesDir , testSandboxID , "resolv.conf" ),
577+ Readonly : false ,
578+ SelinuxRelabel : true ,
568579 },
569580 {
570581 ContainerPath : "/dev/shm" ,
0 commit comments