mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 10:43:56 +00:00
Merge pull request #75128 from bclau/tests/hostpath-privileged-false
tests: creates HostPath pods as unprivileged
This commit is contained in:
commit
69d2e4304a
@ -68,7 +68,9 @@ var _ = Describe("[sig-storage] HostPath", func() {
|
|||||||
source := &v1.HostPathVolumeSource{
|
source := &v1.HostPathVolumeSource{
|
||||||
Path: "/tmp",
|
Path: "/tmp",
|
||||||
}
|
}
|
||||||
pod := testPodWithHostVol(volumePath, source, true)
|
// we can't spawn privileged containers on Windows, nor do we need to.
|
||||||
|
privileged := !framework.NodeOSDistroIs("windows")
|
||||||
|
pod := testPodWithHostVol(volumePath, source, privileged)
|
||||||
|
|
||||||
pod.Spec.Containers[0].Args = []string{
|
pod.Spec.Containers[0].Args = []string{
|
||||||
fmt.Sprintf("--new_file_0644=%v", filePath),
|
fmt.Sprintf("--new_file_0644=%v", filePath),
|
||||||
@ -97,7 +99,10 @@ var _ = Describe("[sig-storage] HostPath", func() {
|
|||||||
source := &v1.HostPathVolumeSource{
|
source := &v1.HostPathVolumeSource{
|
||||||
Path: "/tmp",
|
Path: "/tmp",
|
||||||
}
|
}
|
||||||
pod := testPodWithHostVol(volumePath, source, true)
|
|
||||||
|
// we can't spawn privileged containers on Windows, nor do we need to.
|
||||||
|
privileged := !framework.NodeOSDistroIs("windows")
|
||||||
|
pod := testPodWithHostVol(volumePath, source, privileged)
|
||||||
|
|
||||||
// Write the file in the subPath from container 0
|
// Write the file in the subPath from container 0
|
||||||
container := &pod.Spec.Containers[0]
|
container := &pod.Spec.Containers[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user