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


##########
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:
   Hi @chia7712, thanks for the review.  
   I'm going to change GetApplicationIDFromPod() and GetQueueNameFromPod() in 
[YUNIKORN-2504 ](https://issues.apache.org/jira/browse/YUNIKORN-2504).  This PR 
is focus on Admission Controller change. These two function are not called 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