mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 21:21:14 +00:00
sync api/v1/pod/util with api/pod/util and remove DefaultContainers
This commit is contained in:
@@ -149,7 +149,7 @@ func (d *DenyExec) Validate(ctx context.Context, a admission.Attributes, o admis
|
||||
// isPrivileged will return true a pod has any privileged containers
|
||||
func isPrivileged(pod *corev1.Pod) bool {
|
||||
var privileged bool
|
||||
podutil.VisitContainers(&pod.Spec, func(c *corev1.Container) bool {
|
||||
podutil.VisitContainers(&pod.Spec, podutil.AllContainers, func(c *corev1.Container, containerType podutil.ContainerType) bool {
|
||||
if c.SecurityContext == nil || c.SecurityContext.Privileged == nil {
|
||||
return true
|
||||
}
|
||||
|
Reference in New Issue
Block a user