mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
add test about shutdown but non-existing node.
This commit is contained in:
parent
b48f5af260
commit
84dfaace5d
@ -416,6 +416,37 @@ func Test_NodesShutdown(t *testing.T) {
|
||||
},
|
||||
updatedNodes: []*v1.Node{},
|
||||
},
|
||||
{
|
||||
name: "node is shutdown but provider says it does not exist",
|
||||
fnh: &testutil.FakeNodeHandler{
|
||||
Existing: []*v1.Node{
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "node0",
|
||||
CreationTimestamp: metav1.Date(2012, 1, 1, 0, 0, 0, 0, time.Local),
|
||||
},
|
||||
Status: v1.NodeStatus{
|
||||
Conditions: []v1.NodeCondition{
|
||||
{
|
||||
Type: v1.NodeReady,
|
||||
Status: v1.ConditionUnknown,
|
||||
LastHeartbeatTime: metav1.Date(2015, 1, 1, 12, 0, 0, 0, time.Local),
|
||||
LastTransitionTime: metav1.Date(2015, 1, 1, 12, 0, 0, 0, time.Local),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Clientset: fake.NewSimpleClientset(),
|
||||
UpdatedNodes: []*v1.Node{},
|
||||
},
|
||||
fakeCloud: &fakecloud.Cloud{
|
||||
NodeShutdown: true,
|
||||
ExistsByProviderID: false,
|
||||
ErrShutdownByProviderID: nil,
|
||||
},
|
||||
updatedNodes: []*v1.Node{}, // should be empty because node does not exist
|
||||
},
|
||||
}
|
||||
|
||||
for _, testcase := range testcases {
|
||||
|
Loading…
Reference in New Issue
Block a user