TaoYang526 edited a comment on issue #81: [YUNIKORN-28] Support validating yunikorn-configs before admitting it URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/81#issuecomment-598806310 @wilfred-s @yangwwei I have done the initial update in latest commit which validates configs via /ws/v1/validate-conf REST API (needs to be added later) in yunikorn scheduler, it assumes that we have a service to expose the scheduler REST API, and the service address need to be configured in configs.properties. Changes in core repo like this: ``` routers.go // endpoint to validate conf Route{ "Scheduler", "POST", "/ws/v1/validate-conf", ValidateConf, }, handlers.go func ValidateConf(w http.ResponseWriter, r *http.Request) { writeHeaders(w) var result dao.ValidateConfResponse requestBytes, err := ioutil.ReadAll(r.Body) if err != nil { result.Error = err.Error() } _, err = configs.LoadSchedulerConfigFromByteArray(requestBytes) if err != nil { result.Error = err.Error() } if result.Error == "" { result.Allowed = true } log.Logger().Debug("Validate conf", zap.Any("content", string(requestBytes)), zap.Any("result", result)) if err := json.NewEncoder(w).Encode(result); err != nil { panic(err) } } ``` Could you please take a look at this update and share your thoughts? Thanks.
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
