chia7712 commented on code in PR #873:
URL: https://github.com/apache/yunikorn-k8shim/pull/873#discussion_r1712678176


##########
pkg/cache/context.go:
##########
@@ -295,41 +295,41 @@ func (ctx *Context) UpdatePod(_, newObj interface{}) {
 }
 
 func (ctx *Context) updateYuniKornPod(appID string, pod *v1.Pod) {
-       var app *Application
        taskID := string(pod.UID)
-       if app = ctx.getApplication(appID); app != nil {
+       app := ctx.getApplication(appID)
+       if app != nil {
                if task := app.GetTask(taskID); task != nil {
                        task.setTaskPod(pod)
                }
        }
 
        // treat terminated pods like a remove
        if utils.IsPodTerminated(pod) {
-               ctx.notifyTaskComplete(appID, taskID)
+               if app != nil {

Review Comment:
   I guess `if app != nil {` can be removed now, right?



-- 
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]

Reply via email to