craigcondit commented on code in PR #469:
URL: https://github.com/apache/yunikorn-k8shim/pull/469#discussion_r1026414888
##########
pkg/plugin/admissioncontrollers/webhook/admission_controller.go:
##########
@@ -199,11 +218,10 @@ func (c *admissionController) processPod(req
*admissionv1.AdmissionRequest) *adm
return admissionResponseBuilder(uid, true, "", patchBytes)
}
-func (c *admissionController) processWorkload(req
*admissionv1.AdmissionRequest) *admissionv1.AdmissionResponse {
+func (c *admissionController) processWorkload(req
*admissionv1.AdmissionRequest, namespace string) *admissionv1.AdmissionResponse
{
Review Comment:
Yunikorn processes it, however because the applicationId is missing the
scheduler plug-in goes into no-op mode and passes it through to the underlying
default scheduler.
In standard mode, Yunikorn just bails out and won't schedule the pod at all.
☹️
Technically even this check isn't quite good enough, because we don't
account for user-supplied applicationId being present. We should probably check
for existing appId or spark appId and opt back in to the security checks.
In that case our logic becomes:
shouldProcess && (appId/sparkAppId present || shouldLabel)
That's ugly, but I think correct. Probably build a helper function for this
and we can call it from wherever needed.
--
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]