mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
e2e SecurityContext tests wrong volume dir
The volume directory is not guaranteed to be /var/lib/kubelet for a conforming implementation of Kubernetes. Add --volume-dir and an internal shim
This commit is contained in:
@@ -154,8 +154,8 @@ func testPodSELinuxLabeling(framework *Framework, hostIPC bool, hostPID bool) {
|
||||
|
||||
// Confirm that the file can be accessed from a second
|
||||
// pod using host_path with the same MCS label
|
||||
volumeHostPath := fmt.Sprintf("/var/lib/kubelet/pods/%s/volumes/kubernetes.io~empty-dir/%s", foundPod.UID, volumeName)
|
||||
By("confirming a container with the same label can read the file")
|
||||
volumeHostPath := fmt.Sprintf("%s/pods/%s/volumes/kubernetes.io~empty-dir/%s", testContext.KubeVolumeDir, foundPod.UID, volumeName)
|
||||
By(fmt.Sprintf("confirming a container with the same label can read the file under --volume-dir=%s", testContext.KubeVolumeDir))
|
||||
pod = scTestPod(hostIPC, hostPID)
|
||||
pod.Spec.NodeName = foundPod.Spec.NodeName
|
||||
volumeMounts := []api.VolumeMount{
|
||||
|
||||
Reference in New Issue
Block a user