diff --git a/pkg/descheduler/node/node.go b/pkg/descheduler/node/node.go index 9f7d86d0d..33d9ec5c9 100644 --- a/pkg/descheduler/node/node.go +++ b/pkg/descheduler/node/node.go @@ -117,9 +117,9 @@ func IsReady(node *v1.Node) bool { return true } -// IsNodeUschedulable checks if the node is unschedulable. This is helper function to check only in case of +// IsNodeUnschedulable checks if the node is unschedulable. This is helper function to check only in case of // underutilized node so that they won't be accounted for. -func IsNodeUschedulable(node *v1.Node) bool { +func IsNodeUnschedulable(node *v1.Node) bool { return node.Spec.Unschedulable } @@ -134,7 +134,7 @@ func PodFitsAnyNode(pod *v1.Pod, nodes []*v1.Node) bool { continue } if ok { - if !IsNodeUschedulable(node) { + if !IsNodeUnschedulable(node) { klog.V(2).Infof("Pod %v can possibly be scheduled on %v", pod.Name, node.Name) return true } diff --git a/pkg/descheduler/node/node_test.go b/pkg/descheduler/node/node_test.go index 547adb297..88bc522f5 100644 --- a/pkg/descheduler/node/node_test.go +++ b/pkg/descheduler/node/node_test.go @@ -69,7 +69,7 @@ func TestReadyNodesWithNodeSelector(t *testing.T) { } } -func TestIsNodeUschedulable(t *testing.T) { +func TestIsNodeUnschedulable(t *testing.T) { tests := []struct { description string node *v1.Node @@ -91,7 +91,7 @@ func TestIsNodeUschedulable(t *testing.T) { }, } for _, test := range tests { - actualUnSchedulable := IsNodeUschedulable(test.node) + actualUnSchedulable := IsNodeUnschedulable(test.node) if actualUnSchedulable != test.IsUnSchedulable { t.Errorf("Test %#v failed", test.description) } diff --git a/pkg/descheduler/strategies/lownodeutilization.go b/pkg/descheduler/strategies/lownodeutilization.go index f7d0abdf2..2bd33934c 100644 --- a/pkg/descheduler/strategies/lownodeutilization.go +++ b/pkg/descheduler/strategies/lownodeutilization.go @@ -138,7 +138,7 @@ func classifyNodes(npm NodePodsMap, thresholds api.ResourceThresholds, targetThr nuMap := NodeUsageMap{node, usage, allPods, nonRemovablePods, bePods, bPods, gPods} // Check if node is underutilized and if we can schedule pods on it. - if !nodeutil.IsNodeUschedulable(node) && IsNodeWithLowUtilization(usage, thresholds) { + if !nodeutil.IsNodeUnschedulable(node) && IsNodeWithLowUtilization(usage, thresholds) { klog.V(2).Infof("Node %#v is under utilized with usage: %#v", node.Name, usage) lowNodes = append(lowNodes, nuMap) } else if IsNodeAboveTargetUtilization(usage, targetThresholds) {