pbacsko commented on code in PR #557:
URL: https://github.com/apache/yunikorn-k8shim/pull/557#discussion_r1145802451
##########
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
+ }
return c.namespaceMatchesProcessList(namespace) &&
!c.namespaceMatchesBypassList(namespace)
}
+// shouldLabelNamespace returns true if the pod in the namespace must be
labeled
+// 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) shouldLabelNamespace(namespace string) bool {
+ label := c.nsCache.generateAppID(namespace)
+ if label != -1 {
+ return label == 1
+ }
Review Comment:
Same thing here
--
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]