Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#226 from ankon/pr/node-unschedulab…
Browse files Browse the repository at this point in the history
…le-typo

Fix typo in function name
  • Loading branch information
(Brien Dieterle) committed Feb 7, 2020
2 parents 00ac0de + 8a76a56 commit ffc0999
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pkg/descheduler/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/descheduler/node/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/descheduler/strategies/lownodeutilization.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,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) {
Expand Down

0 comments on commit ffc0999

Please sign in to comment.