pbacsko commented on code in PR #557:
URL: https://github.com/apache/yunikorn-k8shim/pull/557#discussion_r1145802164


##########
pkg/admission/admission_controller.go:
##########
@@ -524,11 +526,28 @@ func (c *AdmissionController) 
namespaceMatchesNoLabelList(namespace string) bool
        return false
 }
 
+// shouldProcessNamespace returns true if the pod in the namespace must be 
redirected to the
+// YuniKorn scheduler by setting the schedulerName
+// First check is the namespace annotation (tri-state)
+// - if present (0, 1) return the value as boolean
+// - if not present (-1) fallback to matching names based on regexp
 func (c *AdmissionController) shouldProcessNamespace(namespace string) bool {
+       process := c.nsCache.enableYuniKorn(namespace)
+       if process != -1 {
+               return process == 1

Review Comment:
   1 / 0 / -1 are special values, could you name them? A bit difficult to 
reason about the logic without names, comments help, but it's better if we can 
follow the code without them.



-- 
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