craigcondit commented on code in PR #900:
URL: https://github.com/apache/yunikorn-k8shim/pull/900#discussion_r1735148079


##########
pkg/cache/task.go:
##########
@@ -533,6 +533,25 @@ func (task *Task) releaseAllocation() {
 // this reduces the scheduling overhead by blocking such
 // request away from the core scheduler.
 func (task *Task) sanityCheckBeforeScheduling() error {
+       // After version 1.7.0, we should reject the task whose pod is unbound 
and has conflicting metadata.
+       if !utils.PodAlreadyBound(task.pod) {
+               if err := utils.CheckAppIdInPod(task.pod); err != nil {
+                       log.Log(log.ShimCacheTask).Warn("The task has 
conflicting metadata will be rejected after version 1.7.0.",
+                               zap.String("appID", task.applicationID),
+                               zap.String("podName", task.pod.Name),
+                               zap.String("error", err.Error()))
+               }
+               if err := utils.CheckQueueNameInPod(task.pod); err != nil {
+                       log.Log(log.ShimCacheTask).Warn("The task has 
conflicting metadata will be rejected after version 1.7.0.",
+                               zap.String("appID", task.applicationID),
+                               zap.String("podName", task.pod.Name),
+                               zap.String("error", err.Error()))
+               }
+       }
+       return task.checkPodPVCs()

Review Comment:
   The pod events need to indicate which fields are inconsistent as well. For 
example:
   
   Pod has inconsistent applciation metadata and may be rejected in a future 
YuniKorn release: label applicationID "foo" doesn't match annotation 
yunikorn.apache.org/app-id "bar"



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