Skip to content

Commit

Permalink
feat(nodeSync): fix bug that node labels is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
D0m021ng committed Jan 12, 2024
1 parent 5c24a54 commit 2b80185
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/job/runtime_v2/client/kube_runtime_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,6 @@ func (n *NodeHandler) addQueue(node *corev1.Node, action pfschema.ActionType, la
capacity[resourceName] = rValue.String()
}
}
if labels == nil {
labels = make(map[string]string)
}
labels[pfschema.PFNodeCardTypeAnno] = n.getNodeCardType(node)
nodeSync := &api.NodeSyncInfo{
Name: node.Name,
Status: getNodeStatus(node),
Expand Down Expand Up @@ -389,6 +385,8 @@ func (n *NodeHandler) UpdateNode(old, new interface{}) {

oldLabels := getLabels(n.labelKeys, oldNode.Labels)
newLabels := getLabels(n.labelKeys, newNode.Labels)
oldLabels[pfschema.PFNodeCardTypeAnno] = n.getNodeCardType(oldNode)
newLabels[pfschema.PFNodeCardTypeAnno] = n.getNodeCardType(newNode)

if oldStatus == newStatus &&
reflect.DeepEqual(oldNode.Status.Allocatable, newNode.Status.Allocatable) &&
Expand Down

0 comments on commit 2b80185

Please sign in to comment.