chenyulin0719 commented on code in PR #871:
URL: https://github.com/apache/yunikorn-k8shim/pull/871#discussion_r1698786987
##########
pkg/common/utils/utils.go:
##########
@@ -154,15 +163,30 @@ func GetApplicationIDFromPod(pod *v1.Pod) string {
}
}
- // Application ID can be defined in annotation
- appID := GetPodAnnotationValue(pod, constants.AnnotationApplicationID)
+ // Application ID can be defined in multiple places
+ // The application ID is determined by the following order.
+ // 1. Label: constants.CanonicalLabelApplicationID
+ // 2. Annotation: constants.AnnotationApplicationID
+ // 3. Label: constants.LabelApplicationID
+ // 4. Label: constants.SparkLabelAppID
Review Comment:
Hi @pbacsko,
I'm not sure whether I catch the question well.
> so label->app vs app->labe
I guess you're saying "**label**->**annotation** vs
**annotation**->**label**"
If yes, I think I have already address it in the unit tests.
-https://github.com/chenyulin0719/yunikorn-k8shim/blob/7f8b8652953cda033a51da17fa1b0a222f24eb8c/pkg/common/utils/utils_test.go#L633-L646
CanonicalLabelApplicationID vs AnnotationApplicationID, then
CanonicalLabelApplicationID win.
AnnotationApplicationID vs LabelApplicationID, then AnnotationApplicationID
win.
--
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]