Description
We use node-selector in volcano scheduler.
containers:
- args:
- --node-selector=train:true
When the volcano-scheduler is running, we remove the label from **the node A **, but volcano still schedules the pod to the node A.
func (sc *SchedulerCache) SyncNode(nodeName string) error {
node, err := sc.nodeInformer.Lister().Get(nodeName)
if err != nil {
if errors.IsNotFound(err) {
deleteErr := sc.RemoveNode(nodeName)
if deleteErr != nil {
klog.Errorf("Failed to delete node <%s> and remove from cache: %s", nodeName, deleteErr.Error())
return deleteErr
}
klog.V(3).Infof("Node <%s> was deleted, removed from cache.", nodeName)
return nil
}
klog.Errorf("Failed to get node %s, error: %v", nodeName, err)
return err
}
if !sc.nodeCanAddCache(node) {
return nil
}
nodeCopy := node.DeepCopy()
csiNode, err := sc.csiNodeInformer.Lister().Get(nodeName)
if err == nil {
sc.setCSIResourceOnNode(csiNode, nodeCopy)
} else if !errors.IsNotFound(err) {
return err
}
return sc.AddOrUpdateNode(nodeCopy)
}
Is the code missing removing node from cache in **if !sc.nodeCanAddCache(node) ** logic ?
Steps to reproduce the issue
Describe the results you received and expected
remove node when remove "the label" from node
What version of Volcano are you using?
master
Any other relevant information
No response
Description
We use node-selector in volcano scheduler.
When the volcano-scheduler is running, we remove the label from **the node A **, but volcano still schedules the pod to the node A.
Is the code missing removing node from cache in **if !sc.nodeCanAddCache(node) ** logic ?
Steps to reproduce the issue
Describe the results you received and expected
remove node when remove "the label" from node
What version of Volcano are you using?
master
Any other relevant information
No response