You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2020/09/01 20:20:22 UTC

[GitHub] [incubator-yunikorn-k8shim] yangwwei commented on a change in pull request #185: [YUNIKORN-386] Passed spark appID in annotation

yangwwei commented on a change in pull request #185:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/185#discussion_r481407225



##########
File path: pkg/common/utils/utils.go
##########
@@ -82,24 +82,30 @@ func GetQueueNameFromPod(pod *v1.Pod) string {
 }
 
 func GetApplicationIDFromPod(pod *v1.Pod) (string, error) {
-	for name, value := range pod.Labels {
-		// if a pod for spark already provided appID, reuse it
-		if name == constants.SparkLabelAppID {
+	// application ID can be defined in annotations
+	for name, value := range pod.Annotations {
+		if name == constants.LabelApplicationID {
+			return value, nil
+		}

Review comment:
       I don't think we need to check `constants.LabelApplicationID` here in this case.
   When we ask users to specify annotations, that should follow the form: "yunikorn.apache.org/app-id".




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org