Add SELinuxOptions to emptyDir e2e

This enables the tests to use the kubelet's SELinux labeling.
Otherwise SELinux will prevent access and the tests fail.
This commit is contained in:
Sami Wagiaalla 2015-10-28 16:23:11 -04:00
parent df234d83cd
commit d43372b901

View File

@ -132,7 +132,6 @@ func doTestSetgidFSGroup(f *Framework, image string, medium api.StorageMedium) {
fmt.Sprintf("--file_owner=%v", filePath),
}
pod.Spec.SecurityContext = &api.PodSecurityContext{}
fsGroup := int64(123)
pod.Spec.SecurityContext.FSGroup = &fsGroup
@ -161,7 +160,7 @@ func doTestVolumeModeFSGroup(f *Framework, image string, medium api.StorageMediu
}
fsGroup := int64(1001)
pod.Spec.SecurityContext = &api.PodSecurityContext{FSGroup: &fsGroup}
pod.Spec.SecurityContext.FSGroup = &fsGroup
msg := fmt.Sprintf("emptydir volume type on %v", formatMedium(medium))
out := []string{
@ -187,7 +186,6 @@ func doTest0644FSGroup(f *Framework, image string, medium api.StorageMedium) {
fmt.Sprintf("--file_perm=%v", filePath),
}
pod.Spec.SecurityContext = &api.PodSecurityContext{}
fsGroup := int64(123)
pod.Spec.SecurityContext.FSGroup = &fsGroup
@ -330,6 +328,11 @@ func testPodWithVolume(image, path string, source *api.EmptyDirVolumeSource) *ap
},
},
},
SecurityContext: &api.PodSecurityContext{
SELinuxOptions: &api.SELinuxOptions{
Level: "s0",
},
},
RestartPolicy: api.RestartPolicyNever,
Volumes: []api.Volume{
{