pbacsko commented on code in PR #864:
URL: https://github.com/apache/yunikorn-k8shim/pull/864#discussion_r1666052274
##########
pkg/cache/context.go:
##########
@@ -296,14 +296,21 @@ func (ctx *Context) UpdatePod(_, newObj interface{}) {
log.Log(log.ShimContext).Error("failed to update pod",
zap.Error(err))
return
}
- if utils.GetApplicationIDFromPod(pod) == "" {
+ applicationID := utils.GetApplicationIDFromPod(pod)
+ if applicationID == "" {
ctx.updateForeignPod(pod)
} else {
- ctx.updateYuniKornPod(pod)
+ ctx.updateYuniKornPod(applicationID, pod)
}
}
-func (ctx *Context) updateYuniKornPod(pod *v1.Pod) {
+func (ctx *Context) updateYuniKornPod(appID string, pod *v1.Pod) {
+ if app := ctx.getApplication(appID); app != nil {
+ if task, err := app.GetTask(string(pod.UID)); task != nil &&
err == nil {
+ task.setTaskPod(pod)
+ }
+ }
+
// treat terminated pods like a remove
if utils.IsPodTerminated(pod) {
if taskMeta, ok := getTaskMetadata(pod); ok {
Review Comment:
Created https://issues.apache.org/jira/browse/YUNIKORN-2724
--
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]