mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +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++ {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user