wilfred-s commented on a change in pull request #149: URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/149#discussion_r451329573
########## File path: pkg/cache/context.go ########## @@ -295,16 +295,25 @@ func (ctx *Context) triggerReloadConfig() { } } -func (ctx *Context) updatePodCondition(pod *v1.Pod, condition *v1.PodCondition) error { - log.Logger.Info("Updating pod condition", +// update pod condition if the condition has changed, it returns a bool value to indicate +// if the update is made or skipped, return an error if it is unable to make the change when it is needed to. +func (ctx *Context) updatePodCondition(pod *v1.Pod, condition *v1.PodCondition) (bool, error) { Review comment: This function should be merged into the caller, or the caller should be merged into this one. There are two layers of functions, two checks for errors and there is a 1:1 relation between `updatePodConditionFn` and `updatePodCondition`. Too complex, does not make sense and uses a number of extra lines. ---------------------------------------------------------------- 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: us...@infra.apache.org