mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Replace calls to cs.CoreV1().Nodes().Create() with createNode()
This commit is contained in:
parent
f054765762
commit
a146cb0aa0
@ -381,7 +381,7 @@ func DoTestPodScheduling(ns *v1.Namespace, t *testing.T, cs clientset.Interface)
|
|||||||
|
|
||||||
for ii := 0; ii < 5; ii++ {
|
for ii := 0; ii < 5; ii++ {
|
||||||
node.Name = fmt.Sprintf("machine%d", ii+1)
|
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)
|
t.Fatalf("Failed to create nodes: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// This file tests the scheduler priority functions.
|
// This file tests the scheduler priority functions.
|
||||||
|
|
||||||
func initTestSchedulerForPriorityTest(t *testing.T, scorePluginName string) *testutils.TestContext {
|
func initTestSchedulerForPriorityTest(t *testing.T, scorePluginName string) *testutils.TestContext {
|
||||||
prof := schedulerconfig.KubeSchedulerProfile{
|
prof := schedulerconfig.KubeSchedulerProfile{
|
||||||
SchedulerName: v1.DefaultSchedulerName,
|
SchedulerName: v1.DefaultSchedulerName,
|
||||||
|
@ -427,7 +427,7 @@ func TestUnschedulableNodes(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for i, mod := range nodeModifications {
|
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 {
|
if err != nil {
|
||||||
t.Fatalf("Failed to create node: %v", err)
|
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
|
// 3. create 3 pods for testing
|
||||||
t.Logf("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)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user