chenyulin0719 commented on code in PR #871:
URL: https://github.com/apache/yunikorn-k8shim/pull/871#discussion_r1675388687


##########
pkg/common/utils/utils.go:
##########
@@ -104,12 +104,20 @@ func IsAssignedPod(pod *v1.Pod) bool {
 }
 
 func GetQueueNameFromPod(pod *v1.Pod) string {
+       // Queue name can be defined in multiple places
+       // The queue name is determined by the following order
+       // 1. Label: constants.CanonicalLabelQueueName
+       // 2. Annotation: constants.AnnotationQueueName
+       // 3. Label: constants.LabelQueueName
        queueName := ""
-       if an := GetPodLabelValue(pod, constants.LabelQueueName); an != "" {
-               queueName = an
-       } else if qu := GetPodAnnotationValue(pod, 
constants.AnnotationQueueName); qu != "" {
-               queueName = qu
+       if canonicalLabelQueueName := GetPodLabelValue(pod, 
constants.CanonicalLabelQueueName); canonicalLabelQueueName != "" {
+               queueName = canonicalLabelQueueName
+       } else if annotationQueueName := GetPodAnnotationValue(pod, 
constants.AnnotationQueueName); annotationQueueName != "" {
+               queueName = annotationQueueName
+       } else if labelQueueName := GetPodLabelValue(pod, 
constants.LabelQueueName); labelQueueName != "" {
+               queueName = labelQueueName
        }
+
        return queueName

Review Comment:
   Note:  the order to fetch queue name from pod is:
   
   Before this PR,
   1. Label: constants.LabelQueueName
   2. Annotation: constants.AnnotationQueueName
   
   After this PR
   1. **Label: constants.CanonicalLabelQueueName (New)**
   2. Annotation: constants.AnnotationQueueName
   3. Label: constants.LabelQueueName (**Previous: constants.LabelQueueName > 
constants.AnnotationQueueName**)
   



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