ryankert01 commented on code in PR #873:
URL: https://github.com/apache/yunikorn-k8shim/pull/873#discussion_r1710708900
##########
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'm with this change. That way, it change the behaviour of
`notifyTaskComplete()` from assuming app is not nil to if nil occur it will
return.
--
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]