fix case where node exists but shutdown.

This commit is contained in:
Indeed 2020-05-04 11:37:18 -07:00
parent 78ace24670
commit 3117b6a084

View File

@ -275,7 +275,7 @@ func Test_NodesShutdown(t *testing.T) {
updatedNodes []*v1.Node updatedNodes []*v1.Node
}{ }{
{ {
name: "node is not ready and was shutdown", name: "node is not ready and was shutdown, but exists",
fnh: &testutil.FakeNodeHandler{ fnh: &testutil.FakeNodeHandler{
Existing: []*v1.Node{ Existing: []*v1.Node{
{ {
@ -283,6 +283,9 @@ func Test_NodesShutdown(t *testing.T) {
Name: "node0", Name: "node0",
CreationTimestamp: metav1.Date(2012, 1, 1, 0, 0, 0, 0, time.Local), CreationTimestamp: metav1.Date(2012, 1, 1, 0, 0, 0, 0, time.Local),
}, },
Spec: v1.NodeSpec{
ProviderID: "node0",
},
Status: v1.NodeStatus{ Status: v1.NodeStatus{
Conditions: []v1.NodeCondition{ Conditions: []v1.NodeCondition{
{ {
@ -300,6 +303,7 @@ func Test_NodesShutdown(t *testing.T) {
}, },
fakeCloud: &fakecloud.Cloud{ fakeCloud: &fakecloud.Cloud{
NodeShutdown: true, NodeShutdown: true,
ExistsByProviderID: true,
ErrShutdownByProviderID: nil, ErrShutdownByProviderID: nil,
}, },
updatedNodes: []*v1.Node{ updatedNodes: []*v1.Node{
@ -309,6 +313,7 @@ func Test_NodesShutdown(t *testing.T) {
CreationTimestamp: metav1.Date(2012, 1, 1, 0, 0, 0, 0, time.Local), CreationTimestamp: metav1.Date(2012, 1, 1, 0, 0, 0, 0, time.Local),
}, },
Spec: v1.NodeSpec{ Spec: v1.NodeSpec{
ProviderID: "node0",
Taints: []v1.Taint{ Taints: []v1.Taint{
*ShutdownTaint, *ShutdownTaint,
}, },