@@ -41,6 +41,7 @@ import (
41
41
"k8s.io/kubernetes/pkg/scheduler/framework/preemption"
42
42
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
43
43
st "k8s.io/kubernetes/pkg/scheduler/testing"
44
+ tf "k8s.io/kubernetes/pkg/scheduler/testing/framework"
44
45
imageutils "k8s.io/kubernetes/test/utils/image"
45
46
46
47
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -143,14 +144,14 @@ func TestPreFilter(t *testing.T) {
143
144
ctx , cancel := context .WithCancel (context .Background ())
144
145
defer cancel ()
145
146
146
- var registerPlugins []st .RegisterPluginFunc
147
+ var registerPlugins []tf .RegisterPluginFunc
147
148
registeredPlugins := append (
148
149
registerPlugins ,
149
- st .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
150
- st .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
150
+ tf .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
151
+ tf .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
151
152
)
152
153
153
- fwk , err := st .NewFramework (
154
+ fwk , err := tf .NewFramework (
154
155
ctx , registeredPlugins , "" ,
155
156
frameworkruntime .WithPodNominator (testutil .NewPodNominator (nil )),
156
157
frameworkruntime .WithSnapshotSharedLister (testutil .NewFakeSharedLister (make ([]* v1.Pod , 0 ), make ([]* v1.Node , 0 ))),
@@ -317,7 +318,7 @@ func TestPostFilter(t *testing.T) {
317
318
ctx , cancel := context .WithCancel (context .Background ())
318
319
defer cancel ()
319
320
320
- fwk , err := st .NewFramework (
321
+ fwk , err := tf .NewFramework (
321
322
ctx ,
322
323
registeredPlugins ,
323
324
"default-scheduler" ,
@@ -444,14 +445,14 @@ func TestReserve(t *testing.T) {
444
445
ctx , cancel := context .WithCancel (context .Background ())
445
446
defer cancel ()
446
447
447
- var registerPlugins []st .RegisterPluginFunc
448
+ var registerPlugins []tf .RegisterPluginFunc
448
449
registeredPlugins := append (
449
450
registerPlugins ,
450
- st .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
451
- st .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
451
+ tf .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
452
+ tf .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
452
453
)
453
454
454
- fwk , err := st .NewFramework (
455
+ fwk , err := tf .NewFramework (
455
456
ctx , registeredPlugins , "" ,
456
457
frameworkruntime .WithPodNominator (testutil .NewPodNominator (nil )),
457
458
frameworkruntime .WithSnapshotSharedLister (testutil .NewFakeSharedLister (make ([]* v1.Pod , 0 ), make ([]* v1.Node , 0 ))),
@@ -566,14 +567,14 @@ func TestUnreserve(t *testing.T) {
566
567
ctx , cancel := context .WithCancel (context .Background ())
567
568
defer cancel ()
568
569
569
- var registerPlugins []st .RegisterPluginFunc
570
+ var registerPlugins []tf .RegisterPluginFunc
570
571
registeredPlugins := append (
571
572
registerPlugins ,
572
- st .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
573
- st .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
573
+ tf .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
574
+ tf .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
574
575
)
575
576
576
- fwk , err := st .NewFramework (
577
+ fwk , err := tf .NewFramework (
577
578
ctx , registeredPlugins , "" ,
578
579
frameworkruntime .WithPodNominator (testutil .NewPodNominator (nil )),
579
580
frameworkruntime .WithSnapshotSharedLister (testutil .NewFakeSharedLister (make ([]* v1.Pod , 0 ), make ([]* v1.Node , 0 ))),
@@ -723,7 +724,7 @@ func TestDryRunPreemption(t *testing.T) {
723
724
cs := clientsetfake .NewSimpleClientset ()
724
725
ctx , cancel := context .WithCancel (context .Background ())
725
726
defer cancel ()
726
- fwk , err := st .NewFramework (
727
+ fwk , err := tf .NewFramework (
727
728
ctx ,
728
729
registeredPlugins ,
729
730
"default-scheduler" ,
@@ -972,7 +973,7 @@ func TestPodEligibleToPreemptOthers(t *testing.T) {
972
973
ctx , cancel := context .WithCancel (context .Background ())
973
974
defer cancel ()
974
975
975
- fwk , err := st .NewFramework (
976
+ fwk , err := tf .NewFramework (
976
977
ctx ,
977
978
registeredPlugins ,
978
979
"default-scheduler" ,
@@ -1129,14 +1130,14 @@ func TestAddElasticQuota(t *testing.T) {
1129
1130
ctx , cancel := context .WithCancel (context .Background ())
1130
1131
defer cancel ()
1131
1132
1132
- var registerPlugins []st .RegisterPluginFunc
1133
+ var registerPlugins []tf .RegisterPluginFunc
1133
1134
registeredPlugins := append (
1134
1135
registerPlugins ,
1135
- st .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
1136
- st .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
1136
+ tf .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
1137
+ tf .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
1137
1138
)
1138
1139
1139
- fwk , err := st .NewFramework (
1140
+ fwk , err := tf .NewFramework (
1140
1141
ctx , registeredPlugins , "" ,
1141
1142
frameworkruntime .WithPodNominator (testutil .NewPodNominator (nil )),
1142
1143
frameworkruntime .WithSnapshotSharedLister (testutil .NewFakeSharedLister (make ([]* v1.Pod , 0 ), make ([]* v1.Node , 0 ))),
@@ -1202,14 +1203,14 @@ func TestUpdateElasticQuota(t *testing.T) {
1202
1203
ctx , cancel := context .WithCancel (context .Background ())
1203
1204
defer cancel ()
1204
1205
1205
- var registerPlugins []st .RegisterPluginFunc
1206
+ var registerPlugins []tf .RegisterPluginFunc
1206
1207
registeredPlugins := append (
1207
1208
registerPlugins ,
1208
- st .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
1209
- st .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
1209
+ tf .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
1210
+ tf .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
1210
1211
)
1211
1212
1212
- fwk , err := st .NewFramework (
1213
+ fwk , err := tf .NewFramework (
1213
1214
ctx , registeredPlugins , "" ,
1214
1215
frameworkruntime .WithPodNominator (testutil .NewPodNominator (nil )),
1215
1216
frameworkruntime .WithSnapshotSharedLister (testutil .NewFakeSharedLister (make ([]* v1.Pod , 0 ), make ([]* v1.Node , 0 ))),
@@ -1254,14 +1255,14 @@ func TestDeleteElasticQuota(t *testing.T) {
1254
1255
ctx , cancel := context .WithCancel (context .Background ())
1255
1256
defer cancel ()
1256
1257
1257
- var registerPlugins []st .RegisterPluginFunc
1258
+ var registerPlugins []tf .RegisterPluginFunc
1258
1259
registeredPlugins := append (
1259
1260
registerPlugins ,
1260
- st .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
1261
- st .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
1261
+ tf .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
1262
+ tf .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
1262
1263
)
1263
1264
1264
- fwk , err := st .NewFramework (
1265
+ fwk , err := tf .NewFramework (
1265
1266
ctx , registeredPlugins , "" ,
1266
1267
frameworkruntime .WithPodNominator (testutil .NewPodNominator (nil )),
1267
1268
frameworkruntime .WithSnapshotSharedLister (testutil .NewFakeSharedLister (make ([]* v1.Pod , 0 ), make ([]* v1.Node , 0 ))),
@@ -1332,14 +1333,14 @@ func TestAddPod(t *testing.T) {
1332
1333
ctx , cancel := context .WithCancel (context .Background ())
1333
1334
defer cancel ()
1334
1335
1335
- var registerPlugins []st .RegisterPluginFunc
1336
+ var registerPlugins []tf .RegisterPluginFunc
1336
1337
registeredPlugins := append (
1337
1338
registerPlugins ,
1338
- st .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
1339
- st .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
1339
+ tf .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
1340
+ tf .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
1340
1341
)
1341
1342
1342
- fwk , err := st .NewFramework (
1343
+ fwk , err := tf .NewFramework (
1343
1344
ctx , registeredPlugins , "" ,
1344
1345
frameworkruntime .WithPodNominator (testutil .NewPodNominator (nil )),
1345
1346
frameworkruntime .WithSnapshotSharedLister (testutil .NewFakeSharedLister (make ([]* v1.Pod , 0 ), make ([]* v1.Node , 0 ))),
@@ -1444,14 +1445,14 @@ func TestUpdatePod(t *testing.T) {
1444
1445
ctx , cancel := context .WithCancel (context .Background ())
1445
1446
defer cancel ()
1446
1447
1447
- var registerPlugins []st .RegisterPluginFunc
1448
+ var registerPlugins []tf .RegisterPluginFunc
1448
1449
registeredPlugins := append (
1449
1450
registerPlugins ,
1450
- st .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
1451
- st .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
1451
+ tf .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
1452
+ tf .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
1452
1453
)
1453
1454
1454
- fwk , err := st .NewFramework (
1455
+ fwk , err := tf .NewFramework (
1455
1456
ctx , registeredPlugins , "" ,
1456
1457
frameworkruntime .WithPodNominator (testutil .NewPodNominator (nil )),
1457
1458
frameworkruntime .WithSnapshotSharedLister (testutil .NewFakeSharedLister (make ([]* v1.Pod , 0 ), make ([]* v1.Node , 0 ))),
@@ -1561,14 +1562,14 @@ func TestDeletePod(t *testing.T) {
1561
1562
ctx , cancel := context .WithCancel (context .Background ())
1562
1563
defer cancel ()
1563
1564
1564
- var registerPlugins []st .RegisterPluginFunc
1565
+ var registerPlugins []tf .RegisterPluginFunc
1565
1566
registeredPlugins := append (
1566
1567
registerPlugins ,
1567
- st .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
1568
- st .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
1568
+ tf .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
1569
+ tf .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
1569
1570
)
1570
1571
1571
- fwk , err := st .NewFramework (
1572
+ fwk , err := tf .NewFramework (
1572
1573
ctx , registeredPlugins , "" ,
1573
1574
frameworkruntime .WithPodNominator (testutil .NewPodNominator (nil )),
1574
1575
frameworkruntime .WithSnapshotSharedLister (testutil .NewFakeSharedLister (make ([]* v1.Pod , 0 ), make ([]* v1.Node , 0 ))),
@@ -1637,12 +1638,12 @@ func makeResourceList(cpu, mem int64) v1.ResourceList {
1637
1638
}
1638
1639
}
1639
1640
1640
- func makeRegisteredPlugin () []st .RegisterPluginFunc {
1641
- registeredPlugins := []st .RegisterPluginFunc {
1642
- st .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
1643
- st .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
1644
- st .RegisterPluginAsExtensions (noderesources .Name , func (plArgs apiruntime.Object , fh framework.Handle ) (framework.Plugin , error ) {
1645
- return noderesources .NewFit (plArgs , fh , plfeature.Features {})
1641
+ func makeRegisteredPlugin () []tf .RegisterPluginFunc {
1642
+ registeredPlugins := []tf .RegisterPluginFunc {
1643
+ tf .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
1644
+ tf .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
1645
+ tf .RegisterPluginAsExtensions (noderesources .Name , func (ctx context. Context , plArgs apiruntime.Object , fh framework.Handle ) (framework.Plugin , error ) {
1646
+ return noderesources .NewFit (ctx , plArgs , fh , plfeature.Features {})
1646
1647
}, "Filter" , "PreFilter" ),
1647
1648
}
1648
1649
return registeredPlugins
0 commit comments