Skip to content

Commit 35b9ab1

Browse files
Remove unnecessary clientset arg from initPausePod
Signed-off-by: Aldo Culquicondor <[email protected]>
1 parent 438debf commit 35b9ab1

File tree

6 files changed

+66
-66
lines changed

6 files changed

+66
-66
lines changed

test/integration/scheduler/framework_test.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ func TestPreFilterPlugin(t *testing.T) {
507507
preFilterPlugin.rejectPreFilter = test.reject
508508
// Create a best effort pod.
509509
pod, err := createPausePod(testCtx.ClientSet,
510-
initPausePod(testCtx.ClientSet, &pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
510+
initPausePod(&pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
511511
if err != nil {
512512
t.Errorf("Error while creating a test pod: %v", err)
513513
}
@@ -559,7 +559,7 @@ func TestScorePlugin(t *testing.T) {
559559
scorePlugin.failScore = fail
560560
// Create a best effort pod.
561561
pod, err := createPausePod(testCtx.ClientSet,
562-
initPausePod(testCtx.ClientSet, &pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
562+
initPausePod(&pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
563563
if err != nil {
564564
t.Fatalf("Error while creating a test pod: %v", err)
565565
}
@@ -617,7 +617,7 @@ func TestNormalizeScorePlugin(t *testing.T) {
617617

618618
// Create a best effort pod.
619619
pod, err := createPausePod(testCtx.ClientSet,
620-
initPausePod(testCtx.ClientSet, &pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
620+
initPausePod(&pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
621621
if err != nil {
622622
t.Fatalf("Error while creating a test pod: %v", err)
623623
}
@@ -666,7 +666,7 @@ func TestReservePlugin(t *testing.T) {
666666
reservePlugin.failReserve = fail
667667
// Create a best effort pod.
668668
pod, err := createPausePod(testCtx.ClientSet,
669-
initPausePod(testCtx.ClientSet, &pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
669+
initPausePod(&pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
670670
if err != nil {
671671
t.Errorf("Error while creating a test pod: %v", err)
672672
}
@@ -744,7 +744,7 @@ func TestPrebindPlugin(t *testing.T) {
744744
preBindPlugin.rejectPreBind = test.reject
745745
// Create a best effort pod.
746746
pod, err := createPausePod(testCtx.ClientSet,
747-
initPausePod(testCtx.ClientSet, &pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
747+
initPausePod(&pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
748748
if err != nil {
749749
t.Errorf("Error while creating a test pod: %v", err)
750750
}
@@ -819,7 +819,7 @@ func TestUnreservePlugin(t *testing.T) {
819819

820820
// Create a best effort pod.
821821
pod, err := createPausePod(testCtx.ClientSet,
822-
initPausePod(testCtx.ClientSet, &pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
822+
initPausePod(&pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
823823
if err != nil {
824824
t.Errorf("Error while creating a test pod: %v", err)
825825
}
@@ -953,7 +953,7 @@ func TestBindPlugin(t *testing.T) {
953953

954954
// Create a best effort pod.
955955
pod, err := createPausePod(testCtx.ClientSet,
956-
initPausePod(testCtx.ClientSet, &pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
956+
initPausePod(&pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
957957
if err != nil {
958958
t.Errorf("Error while creating a test pod: %v", err)
959959
}
@@ -1080,7 +1080,7 @@ func TestPostBindPlugin(t *testing.T) {
10801080

10811081
// Create a best effort pod.
10821082
pod, err := createPausePod(testCtx.ClientSet,
1083-
initPausePod(testCtx.ClientSet, &pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
1083+
initPausePod(&pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
10841084
if err != nil {
10851085
t.Errorf("Error while creating a test pod: %v", err)
10861086
}
@@ -1165,7 +1165,7 @@ func TestPermitPlugin(t *testing.T) {
11651165

11661166
// Create a best effort pod.
11671167
pod, err := createPausePod(testCtx.ClientSet,
1168-
initPausePod(testCtx.ClientSet, &pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
1168+
initPausePod(&pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
11691169
if err != nil {
11701170
t.Errorf("Error while creating a test pod: %v", err)
11711171
}
@@ -1214,7 +1214,7 @@ func TestMultiplePermitPlugins(t *testing.T) {
12141214
// Create a test pod.
12151215
podName := "test-pod"
12161216
pod, err := createPausePod(testCtx.ClientSet,
1217-
initPausePod(testCtx.ClientSet, &pausePodConfig{Name: podName, Namespace: testCtx.NS.Name}))
1217+
initPausePod(&pausePodConfig{Name: podName, Namespace: testCtx.NS.Name}))
12181218
if err != nil {
12191219
t.Errorf("Error while creating a test pod: %v", err)
12201220
}
@@ -1269,7 +1269,7 @@ func TestPermitPluginsCancelled(t *testing.T) {
12691269
// Create a test pod.
12701270
podName := "test-pod"
12711271
pod, err := createPausePod(testCtx.ClientSet,
1272-
initPausePod(testCtx.ClientSet, &pausePodConfig{Name: podName, Namespace: testCtx.NS.Name}))
1272+
initPausePod(&pausePodConfig{Name: podName, Namespace: testCtx.NS.Name}))
12731273
if err != nil {
12741274
t.Errorf("Error while creating a test pod: %v", err)
12751275
}
@@ -1328,12 +1328,12 @@ func TestCoSchedulingWithPermitPlugin(t *testing.T) {
13281328
// Create two pods. First pod to enter Permit() will wait and a second one will either
13291329
// reject or allow first one.
13301330
podA, err := createPausePod(testCtx.ClientSet,
1331-
initPausePod(testCtx.ClientSet, &pausePodConfig{Name: "pod-a", Namespace: testCtx.NS.Name}))
1331+
initPausePod(&pausePodConfig{Name: "pod-a", Namespace: testCtx.NS.Name}))
13321332
if err != nil {
13331333
t.Errorf("Error while creating the first pod: %v", err)
13341334
}
13351335
podB, err := createPausePod(testCtx.ClientSet,
1336-
initPausePod(testCtx.ClientSet, &pausePodConfig{Name: "pod-b", Namespace: testCtx.NS.Name}))
1336+
initPausePod(&pausePodConfig{Name: "pod-b", Namespace: testCtx.NS.Name}))
13371337
if err != nil {
13381338
t.Errorf("Error while creating the second pod: %v", err)
13391339
}
@@ -1403,7 +1403,7 @@ func TestFilterPlugin(t *testing.T) {
14031403
filterPlugin.failFilter = fail
14041404
// Create a best effort pod.
14051405
pod, err := createPausePod(testCtx.ClientSet,
1406-
initPausePod(testCtx.ClientSet, &pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
1406+
initPausePod(&pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
14071407
if err != nil {
14081408
t.Errorf("Error while creating a test pod: %v", err)
14091409
}
@@ -1457,7 +1457,7 @@ func TestPreScorePlugin(t *testing.T) {
14571457
preScorePlugin.failPreScore = fail
14581458
// Create a best effort pod.
14591459
pod, err := createPausePod(testCtx.ClientSet,
1460-
initPausePod(testCtx.ClientSet, &pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
1460+
initPausePod(&pausePodConfig{Name: "test-pod", Namespace: testCtx.NS.Name}))
14611461
if err != nil {
14621462
t.Errorf("Error while creating a test pod: %v", err)
14631463
}
@@ -1517,7 +1517,7 @@ func TestPreemptWithPermitPlugin(t *testing.T) {
15171517
}
15181518

15191519
// First pod will go waiting.
1520-
waitingPod := initPausePod(testCtx.ClientSet, &pausePodConfig{Name: "waiting-pod", Namespace: testCtx.NS.Name, Priority: &lowPriority, Resources: &resourceRequest})
1520+
waitingPod := initPausePod(&pausePodConfig{Name: "waiting-pod", Namespace: testCtx.NS.Name, Priority: &lowPriority, Resources: &resourceRequest})
15211521
waitingPod.Spec.TerminationGracePeriodSeconds = new(int64)
15221522
waitingPod, err = createPausePod(testCtx.ClientSet, waitingPod)
15231523
if err != nil {
@@ -1532,7 +1532,7 @@ func TestPreemptWithPermitPlugin(t *testing.T) {
15321532

15331533
// Create second pod which should preempt first pod.
15341534
preemptorPod, err := createPausePod(testCtx.ClientSet,
1535-
initPausePod(testCtx.ClientSet, &pausePodConfig{Name: "preemptor-pod", Namespace: testCtx.NS.Name, Priority: &highPriority, Resources: &resourceRequest}))
1535+
initPausePod(&pausePodConfig{Name: "preemptor-pod", Namespace: testCtx.NS.Name, Priority: &highPriority, Resources: &resourceRequest}))
15361536
if err != nil {
15371537
t.Errorf("Error while creating the preemptor pod: %v", err)
15381538
}

test/integration/scheduler/plugins_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func TestNodeResourceLimits(t *testing.T) {
5454
}
5555

5656
podName := "pod-with-resource-limits"
57-
pod, err := runPausePod(testCtx.ClientSet, initPausePod(testCtx.ClientSet, &pausePodConfig{
57+
pod, err := runPausePod(testCtx.ClientSet, initPausePod(&pausePodConfig{
5858
Name: podName,
5959
Namespace: testCtx.NS.Name,
6060
Resources: &v1.ResourceRequirements{Requests: v1.ResourceList{

0 commit comments

Comments
 (0)