kingamarton commented on a change in pull request #308:
URL:
https://github.com/apache/incubator-yunikorn-k8shim/pull/308#discussion_r725020767
##########
File path: pkg/plugin/admissioncontrollers/webhook/admission_controller.go
##########
@@ -229,38 +234,47 @@ func (c *admissionController) validateConf(ar
*v1beta1.AdmissionReview) *v1beta1
},
}
}
+
+ if skipped {
+ return &v1beta1.AdmissionResponse{
+ Allowed: true,
+ Result: &metav1.Status{
+ Message: skippedByController,
+ },
+ }
+ }
}
return &v1beta1.AdmissionResponse{
Allowed: true,
}
}
-func (c *admissionController) validateConfigMap(cm *v1.ConfigMap) error {
+func (c *admissionController) validateConfigMap(cm *v1.ConfigMap) (error,
bool) {
Review comment:
Instead of adding additional complexity to the code by introduving a
second return value, I think we should simplify the check: for example if the
input is not a configmap and not our config, return nil (as it was initially).
This would require a small change in validateConf() function to return nil
instead of a valid AdmissionResponse.
This would require some manual testing, to make sure that the nil return
value is not causing any issues
--
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]