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


##########
pkg/admission/util.go:
##########
@@ -37,26 +37,40 @@ func updatePodLabel(pod *v1.Pod, namespace string, 
generateUniqueAppIds bool, de
        }
 
        sparkAppID := utils.GetPodLabelValue(pod, constants.SparkLabelAppID)
+       canonicalAppID := utils.GetPodLabelValue(pod, 
constants.CanonicalLabelApplicationID)
        appID := utils.GetPodLabelValue(pod, constants.LabelApplicationID)
-       if sparkAppID == "" && appID == "" {
+       if canonicalAppID == "" && sparkAppID == "" && appID == "" {
                // if app id not exist, generate one
                // for each namespace, we group unnamed pods to one single app 
- if GenerateUniqueAppId is not set
                // if GenerateUniqueAppId:
                //              application ID convention: 
${NAMESPACE}-${POD_UID}
                // else
                //              application ID convention: 
${AUTO_GEN_PREFIX}-${NAMESPACE}-${AUTO_GEN_SUFFIX}
                generatedID := utils.GenerateApplicationID(namespace, 
generateUniqueAppIds, string(pod.UID))
+
+               result[constants.CanonicalLabelApplicationID] = generatedID

Review Comment:
   Merged with the changes in YUNIKORN-2636. 
   
   Based on the same reason in YUNIKORN-2636's discussion.
   - https://github.com/apache/yunikorn-k8shim/pull/848#discussion_r1611634390
   
   I'm not going to chang to use 
GetApplicationIDFromPod()/GetQueueNameFromPod() in Admission Controller.



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