kubernetes/pkg/api/pod
Rodrigo Campos 5f7e611f73 validation: Return error if hostUsers=false && volumeDevices
Now if a pod tries to use user namespaces (hostUsers: false) and a
volume device, it will see this error:
	$ kubectl apply -f pod.yaml
	...
	* spec.ephemeralContainers[0].volumeDevices: Forbidden: when `pod.Spec.HostUsers` is false
	* spec.initContainers[0].volumeDevices: Forbidden: when `pod.Spec.HostUsers` is false
	* spec.containers[0].volumeDevices: Forbidden: when `pod.Spec.HostUsers` is false

Note that if a pod is already created with volumeDevices and userns,
then we allow modifications to that object.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2025-07-28 16:54:08 +02:00
..
testing Validation 2025-03-25 01:58:04 +05:30
OWNERS Check in OWNERS modified by update-yamlfmt.sh 2021-12-09 21:31:26 -05:00
util.go validation: Return error if hostUsers=false && volumeDevices 2025-07-28 16:54:08 +02:00
util_test.go validation: Return error if hostUsers=false && volumeDevices 2025-07-28 16:54:08 +02:00
warnings.go Pod Certificates: Basic implementation 2025-07-21 21:49:57 +00:00
warnings_test.go Pod Certificates: Basic implementation 2025-07-21 21:49:57 +00:00