diff --git a/test/integration/scheduler/extender_test.go b/test/integration/scheduler/extender_test.go index f39600e5607..f2fbe2bdd36 100644 --- a/test/integration/scheduler/extender_test.go +++ b/test/integration/scheduler/extender_test.go @@ -381,7 +381,7 @@ func DoTestPodScheduling(ns *v1.Namespace, t *testing.T, cs clientset.Interface) for ii := 0; ii < 5; ii++ { node.Name = fmt.Sprintf("machine%d", ii+1) - if _, err := cs.CoreV1().Nodes().Create(context.TODO(), node, metav1.CreateOptions{}); err != nil { + if _, err := createNode(cs, node); err != nil { t.Fatalf("Failed to create nodes: %v", err) } } diff --git a/test/integration/scheduler/priorities_test.go b/test/integration/scheduler/priorities_test.go index d853d0ee86a..d6475da88f3 100644 --- a/test/integration/scheduler/priorities_test.go +++ b/test/integration/scheduler/priorities_test.go @@ -39,7 +39,6 @@ import ( ) // This file tests the scheduler priority functions. - func initTestSchedulerForPriorityTest(t *testing.T, scorePluginName string) *testutils.TestContext { prof := schedulerconfig.KubeSchedulerProfile{ SchedulerName: v1.DefaultSchedulerName, diff --git a/test/integration/scheduler/scheduler_test.go b/test/integration/scheduler/scheduler_test.go index 1f3e4b204c9..5d10ef3c51d 100644 --- a/test/integration/scheduler/scheduler_test.go +++ b/test/integration/scheduler/scheduler_test.go @@ -427,7 +427,7 @@ func TestUnschedulableNodes(t *testing.T) { } for i, mod := range nodeModifications { - unSchedNode, err := testCtx.ClientSet.CoreV1().Nodes().Create(context.TODO(), node, metav1.CreateOptions{}) + unSchedNode, err := createNode(testCtx.ClientSet, node) if err != nil { t.Fatalf("Failed to create node: %v", err) } @@ -510,7 +510,7 @@ func TestMultipleSchedulers(t *testing.T) { }, }, } - testCtx.ClientSet.CoreV1().Nodes().Create(context.TODO(), node, metav1.CreateOptions{}) + createNode(testCtx.ClientSet, node) // 3. create 3 pods for testing t.Logf("create 3 pods for testing") @@ -635,7 +635,7 @@ func TestMultipleSchedulingProfiles(t *testing.T) { }, }, } - if _, err := testCtx.ClientSet.CoreV1().Nodes().Create(context.TODO(), node, metav1.CreateOptions{}); err != nil { + if _, err := createNode(testCtx.ClientSet, node); err != nil { t.Fatal(err) }