Skip to content

Commit c85a4cc

Browse files
author
Harry Li
committed
feat(webhook): add additional check for initContainers
1 parent 6e77919 commit c85a4cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/scheduler/webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func (h *webhook) Handle(_ context.Context, req admission.Request) admission.Res
6868
}
6969
klog.Infof(template, pod.Namespace, pod.Name, pod.UID)
7070
hasResource := false
71-
for idx, ctr := range pod.Spec.Containers {
71+
for idx, ctr := range append(pod.Spec.Containers, pod.Spec.InitContainers...) {
7272
c := &pod.Spec.Containers[idx]
7373
if ctr.SecurityContext != nil {
7474
if ctr.SecurityContext.Privileged != nil && *ctr.SecurityContext.Privileged {

0 commit comments

Comments
 (0)