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 2021/08/26 06:00:19 UTC

[GitHub] [incubator-yunikorn-k8shim] yangwwei commented on a change in pull request #297: [YUNIKORN-811] Discover daemonset pods and parse nodeaffinity value to allocationAsk tags

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



##########
File path: pkg/common/si_helper.go
##########
@@ -30,15 +30,21 @@ import (
 func CreateTagsForTask(pod *v1.Pod) map[string]string {
 	metaPrefix := common.DomainK8s + common.GroupMeta
 	tags := map[string]string{
-		metaPrefix + common.KeyNamespace:                      pod.Namespace,
-		metaPrefix + common.KeyPodName:                        pod.Name,
-		common.DomainYuniKorn + common.KeyIgnoreUnschedulable: "false",
+		metaPrefix + common.KeyNamespace: pod.Namespace,
+		metaPrefix + common.KeyPodName:   pod.Name,
 	}
 	owners := pod.GetOwnerReferences()
 	if len(owners) > 0 {
 		for _, value := range owners {
 			if value.Kind == constants.DaemonSetType {
-				tags[common.DomainYuniKorn+common.KeyIgnoreUnschedulable] = "true"
+				nodeSelectorTerms := pod.Spec.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution.NodeSelectorTerms

Review comment:
       we need to add nil check for
   - pod.Spec.Affinity
   - pod.Spec.Affinity. NodeAffinity
   - pod.Spec.Affinity. NodeAffinity. RequiredDuringSchedulingIgnoredDuringExecution
   
   just to make sure this won't give us any NPE
   
   




-- 
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: reviews-unsubscribe@yunikorn.apache.org

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