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/09/23 19:36:13 UTC

[GitHub] [incubator-yunikorn-k8shim] chenya-zhang commented on a change in pull request #305: [YUNIKORN-858] Pass node labels as node attributes for node sorting

chenya-zhang commented on a change in pull request #305:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/305#discussion_r715095786



##########
File path: pkg/cache/nodes.go
##########
@@ -100,10 +101,18 @@ func (nc *schedulerNodes) addAndReportNode(node *v1.Node, reportNode bool) {
 
 	// add node to nodes map
 	if _, ok := nc.nodesMap[node.Name]; !ok {
+		nodeLabels, err := json.Marshal(node.Labels)
+		if err != nil {
+			log.Logger().Error("failed to marshall node labels to json", zap.Error(err))
+			return

Review comment:
       Yeah, good catch. 
   
   Since we are only using node labels to support node affinity with a **_preferred_** scheduling policy, it makes sense to not skip this node even if labels can't be marshaled.  




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