@@ -30,8 +30,6 @@ import (
30
30
"k8s.io/apimachinery/pkg/runtime"
31
31
"k8s.io/apimachinery/pkg/types"
32
32
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
33
- "sigs.k8s.io/controller-runtime/pkg/client"
34
- "sigs.k8s.io/controller-runtime/pkg/client/config"
35
33
"sigs.k8s.io/controller-runtime/pkg/client/fake"
36
34
"sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2"
37
35
backendmetrics "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/backend/metrics"
@@ -359,10 +357,6 @@ func TestMetrics(t *testing.T) {
359
357
}
360
358
361
359
func TestPods (t * testing.T ) {
362
- poolSelector := map [string ]string {"app" : "vllm_v1" }
363
- pool := testutil .MakeInferencePool ("pool" ).
364
- Namespace ("default" ).
365
- Selector (poolSelector ).ObjRef ()
366
360
updatedPod := & corev1.Pod {
367
361
ObjectMeta : metav1.ObjectMeta {
368
362
Name : "pod1" ,
@@ -371,10 +365,6 @@ func TestPods(t *testing.T) {
371
365
NodeName : "node-1" ,
372
366
},
373
367
}
374
- resyncPoolSelector := map [string ]string {"app" : "llama3_8b" }
375
- resyncPool := testutil .MakeInferencePool ("pool" ).
376
- Namespace ("default" ).
377
- Selector (resyncPoolSelector ).ObjRef ()
378
368
tests := []struct {
379
369
name string
380
370
op func (ctx context.Context , ds Datastore )
@@ -386,23 +376,23 @@ func TestPods(t *testing.T) {
386
376
existingPods : []* corev1.Pod {},
387
377
wantPods : []* corev1.Pod {pod1 },
388
378
op : func (ctx context.Context , ds Datastore ) {
389
- ds .PodUpdateOrAddIfNotExist (pod1 , pool )
379
+ ds .PodUpdateOrAddIfNotExist (pod1 )
390
380
},
391
381
},
392
382
{
393
383
name : "Add new pod, with existing pods, should add" ,
394
384
existingPods : []* corev1.Pod {pod1 },
395
385
wantPods : []* corev1.Pod {pod1 , pod2 },
396
386
op : func (ctx context.Context , ds Datastore ) {
397
- ds .PodUpdateOrAddIfNotExist (pod2 , pool )
387
+ ds .PodUpdateOrAddIfNotExist (pod2 )
398
388
},
399
389
},
400
390
{
401
391
name : "Update existing pod, new field, should update" ,
402
392
existingPods : []* corev1.Pod {pod1 },
403
393
wantPods : []* corev1.Pod {updatedPod },
404
394
op : func (ctx context.Context , ds Datastore ) {
405
- ds .PodUpdateOrAddIfNotExist (updatedPod , pool )
395
+ ds .PodUpdateOrAddIfNotExist (updatedPod )
406
396
},
407
397
},
408
398
{
@@ -416,21 +406,7 @@ func TestPods(t *testing.T) {
416
406
Namespace : "default" ,
417
407
},
418
408
}
419
- ds .PodUpdateOrAddIfNotExist (incoming , pool )
420
- },
421
- },
422
- {
423
- name : "Change pool selector, resync required, should update" ,
424
- existingPods : []* corev1.Pod {pod1 , pod2 },
425
- wantPods : []* corev1.Pod {pod1 , pod2 },
426
- op : func (ctx context.Context , ds Datastore ) {
427
- scheme := runtime .NewScheme ()
428
- cfg := config .GetConfigOrDie ()
429
- cli , err := client .New (cfg , client.Options {Scheme : scheme })
430
- if err != nil {
431
- t .Fatalf ("Unable to create ctrl runtime client" )
432
- }
433
- ds .PodResyncAll (ctx , cli , resyncPool )
409
+ ds .PodUpdateOrAddIfNotExist (incoming )
434
410
},
435
411
},
436
412
{
@@ -455,7 +431,7 @@ func TestPods(t *testing.T) {
455
431
pmf := backendmetrics .NewPodMetricsFactory (& backendmetrics.FakePodMetricsClient {}, time .Second )
456
432
ds := NewDatastore (t .Context (), pmf )
457
433
for _ , pod := range test .existingPods {
458
- ds .PodUpdateOrAddIfNotExist (pod , pool )
434
+ ds .PodUpdateOrAddIfNotExist (pod )
459
435
}
460
436
461
437
test .op (ctx , ds )
0 commit comments