wilfred-s commented on a change in pull request #240:
URL:
https://github.com/apache/incubator-yunikorn-k8shim/pull/240#discussion_r594933303
##########
File path: pkg/plugin/predicates/predictor.go
##########
@@ -278,8 +283,10 @@ func (p *Predictor) predicatesAllocate(pod *v1.Pod, meta
predicates.PredicateMet
}
if !fit {
- events.GetRecorder().Eventf(pod,
v1.EventTypeWarning,
- "FailedScheduling", "%v", reasons)
+ if isAllowed := limiter.AllowN(time.Now(), 1);
isAllowed {
Review comment:
This can be simplified to just become `if limiter.Allow() {`
Beside the minor issue with the simplification the change looks good.
----------------------------------------------------------------
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]