Skip to content

Commit

Permalink
fix some bug
Browse files Browse the repository at this point in the history
  • Loading branch information
payall4u committed Nov 29, 2023
1 parent 85ed9fb commit 77006c1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/webhooks/pod/mutating.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 77006c1

Please sign in to comment.