Make fake node as ready but unschedulable

This commit is contained in:
carlory 2024-11-08 18:12:18 +08:00
parent c25f5eefe4
commit f0f319c6af

View File

@ -53,15 +53,21 @@ var _ = SIGDescribe("Node Lifecycle", func() {
nodeClient := f.ClientSet.CoreV1().Nodes()
// Create a fake node with a ready condition but unschedulable, so it won't be selected by
// the scheduler and won't be deleted by the cloud controller manager when the test runs on
// a specific cloud provider.
fakeNode := v1.Node{
ObjectMeta: metav1.ObjectMeta{
Name: "e2e-fake-node-" + utilrand.String(5),
},
Spec: v1.NodeSpec{
Unschedulable: true,
},
Status: v1.NodeStatus{
Phase: v1.NodeRunning,
Conditions: []v1.NodeCondition{
{
Status: v1.ConditionFalse,
Status: v1.ConditionTrue,
Message: "Set from e2e test",
Reason: "E2E",
Type: v1.NodeReady,