Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.

Commit a871bb9

Browse files
committed
Update nodeInfo once node was cordon(ed)
1 parent c4896a4 commit a871bb9

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pkg/scheduler/cache/event_handlers.go

+10-3
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,16 @@ func (sc *SchedulerCache) addNode(node *v1.Node) error {
240240
}
241241

242242
func isNodeInfoUpdated(oldNode, newNode *v1.Node) bool {
243-
return !reflect.DeepEqual(oldNode.Status.Allocatable, newNode.Status.Allocatable) ||
244-
!reflect.DeepEqual(oldNode.Spec.Taints, newNode.Spec.Taints) ||
245-
!reflect.DeepEqual(oldNode.Labels, newNode.Labels)
243+
switch {
244+
// TODO(jiaxuanzhou): reserved for predictions for volumes.
245+
case !reflect.DeepEqual(oldNode.Status, newNode.Status):
246+
return !reflect.DeepEqual(oldNode.Status.Allocatable, newNode.Status.Allocatable)
247+
case !reflect.DeepEqual(oldNode.Spec, newNode.Spec):
248+
return !reflect.DeepEqual(oldNode.Spec.Taints, newNode.Spec.Taints) ||
249+
!reflect.DeepEqual(oldNode.Spec.Unschedulable, newNode.Spec.Unschedulable)
250+
default:
251+
return !reflect.DeepEqual(oldNode.Labels, newNode.Labels)
252+
}
246253
}
247254

248255
// Assumes that lock is already acquired.

0 commit comments

Comments
 (0)