chenyulin0719 commented on code in PR #966:
URL: https://github.com/apache/yunikorn-k8shim/pull/966#discussion_r2050708824


##########
pkg/admission/admission_controller.go:
##########
@@ -194,7 +194,16 @@ func (c *AdmissionController) processPod(req 
*admissionv1.AdmissionRequest, name
                log.Log(log.Admission).Info("bypassing namespace", 
zap.String("namespace", namespace))
                return admissionResponseBuilder(uid, true, "", nil)
        }
-       patch = updateSchedulerName(patch)
+
+       // Only override default-scheduler unless override is enabled
+       if pod.Spec.SchedulerName == "default-scheduler" ||
+               (c.conf.GetOverrideCustomSchedulers() && pod.Spec.SchedulerName 
!= constants.SchedulerName) {
+               patch = updateSchedulerName(patch)
+       } else {
+               log.Log(log.Admission).Info("bypassing scheduler name update",
+                       zap.String("schedulerName", pod.Spec.SchedulerName),
+                       zap.Bool("overrideCustomSchedulers", 
c.conf.GetOverrideCustomSchedulers()))
+       }

Review Comment:
   It seems that all pods without changing scheduler name are printing this 
log, which might not be necessary.
   
   We can change it to only print the log when the scheduler name is actually 
modified.
   Or perhaps we can remove the logging altogether, since we will log the patch 
later anyway



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to