1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-28 22:57:35 +01:00

Changes to fix low node utilization strategy

This commit is contained in:
ravisantoshgudimetla
2017-11-27 15:28:30 -05:00
parent d2bd16a12d
commit 6dbc8a1fcc
4 changed files with 62 additions and 10 deletions

View File

@@ -72,3 +72,33 @@ func TestReadyNodesWithNodeSelector(t *testing.T) {
t.Errorf("Expected node1, got %s", nodes[0].Name)
}
}
func TestIsNodeUschedulable(t *testing.T) {
tests := []struct {
description string
node *v1.Node
IsUnSchedulable bool
}{
{
description: "Node is expected to be schedulable",
node: &v1.Node{
Spec: v1.NodeSpec{Unschedulable: false},
},
IsUnSchedulable: false,
},
{
description: "Node is not expected to be schedulable because of unschedulable field",
node: &v1.Node{
Spec: v1.NodeSpec{Unschedulable: true},
},
IsUnSchedulable: true,
},
}
for _, test := range tests {
actualUnSchedulable := IsNodeUschedulable(test.node)
if actualUnSchedulable != test.IsUnSchedulable {
t.Errorf("Test %#v failed", test.description)
}
}
}