From 3117b6a08469cdaa61fa4283287fc8694185425a Mon Sep 17 00:00:00 2001 From: Indeed Date: Mon, 4 May 2020 11:37:18 -0700 Subject: [PATCH] fix case where node exists but shutdown. --- pkg/controller/cloud/node_lifecycle_controller_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/controller/cloud/node_lifecycle_controller_test.go b/pkg/controller/cloud/node_lifecycle_controller_test.go index 9db1cfd4505..6188e75fb40 100644 --- a/pkg/controller/cloud/node_lifecycle_controller_test.go +++ b/pkg/controller/cloud/node_lifecycle_controller_test.go @@ -275,7 +275,7 @@ func Test_NodesShutdown(t *testing.T) { updatedNodes []*v1.Node }{ { - name: "node is not ready and was shutdown", + name: "node is not ready and was shutdown, but exists", fnh: &testutil.FakeNodeHandler{ Existing: []*v1.Node{ { @@ -283,6 +283,9 @@ func Test_NodesShutdown(t *testing.T) { Name: "node0", CreationTimestamp: metav1.Date(2012, 1, 1, 0, 0, 0, 0, time.Local), }, + Spec: v1.NodeSpec{ + ProviderID: "node0", + }, Status: v1.NodeStatus{ Conditions: []v1.NodeCondition{ { @@ -300,6 +303,7 @@ func Test_NodesShutdown(t *testing.T) { }, fakeCloud: &fakecloud.Cloud{ NodeShutdown: true, + ExistsByProviderID: true, ErrShutdownByProviderID: nil, }, 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), }, Spec: v1.NodeSpec{ + ProviderID: "node0", Taints: []v1.Taint{ *ShutdownTaint, },