Replace calls to cs.CoreV1().Nodes().Create() with createNode()

This commit is contained in:
Wei Huang
2020-10-30 13:35:50 -07:00
parent f054765762
commit a146cb0aa0
3 changed files with 4 additions and 5 deletions

View File

@@ -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)
}