diff --git a/pkg/webhooks/pod/mutating.go b/pkg/webhooks/pod/mutating.go index 53c9de9e8..c1dbd6ec6 100644 --- a/pkg/webhooks/pod/mutating.go +++ b/pkg/webhooks/pod/mutating.go @@ -50,10 +50,9 @@ func (m *MutatingAdmission) Default(ctx context.Context, obj runtime.Object) err return err } - if ls.Matches(labels.Set(pod.Labels)) { - if m.Config.QOSInitializer.InitContainerTemplate != nil { - pod.Spec.InitContainers = append(pod.Spec.InitContainers, *m.Config.QOSInitializer.InitContainerTemplate) - } + if !ls.Matches(labels.Set(pod.Labels)) { + klog.Infof("injection skipped: webhook is not interested in the pod") + return nil } qosSlice, err := m.listPodQOS()