@@ -45,27 +45,37 @@ var (
45
45
Namespace (pool .Namespace ).
46
46
Criticality (v1alpha2 .Standard ).
47
47
CreationTimestamp (metav1 .Unix (1000 , 0 )).
48
- PoolName (pool .Name ).ObjRef ()
48
+ PoolName (pool .Name ).
49
+ PoolGroup ("inference.networking.k8s.io" ).ObjRef ()
49
50
infObjective1Pool2 = utiltest .MakeInferenceObjective (infObjective1 .Name ).
50
51
Namespace (infObjective1 .Namespace ).
51
52
Criticality (* infObjective1 .Spec .Criticality ).
52
53
CreationTimestamp (metav1 .Unix (1001 , 0 )).
53
- PoolName ("test-pool2" ).ObjRef ()
54
+ PoolName ("test-pool2" ).
55
+ PoolGroup ("inference.networking.k8s.io" ).ObjRef ()
54
56
infObjective1Critical = utiltest .MakeInferenceObjective (infObjective1 .Name ).
55
57
Namespace (infObjective1 .Namespace ).
56
58
Criticality (v1alpha2 .Critical ).
57
59
CreationTimestamp (metav1 .Unix (1003 , 0 )).
58
- PoolName (pool .Name ).ObjRef ()
60
+ PoolName (pool .Name ).
61
+ PoolGroup ("inference.networking.k8s.io" ).ObjRef ()
59
62
infObjective1Deleted = utiltest .MakeInferenceObjective (infObjective1 .Name ).
60
63
Namespace (infObjective1 .Namespace ).
61
64
CreationTimestamp (metav1 .Unix (1004 , 0 )).
62
65
DeletionTimestamp ().
63
- PoolName (pool .Name ).ObjRef ()
64
-
66
+ PoolName (pool .Name ).
67
+ PoolGroup ("inference.networking.k8s.io" ).ObjRef ()
68
+ infObjective1DiffGroup = utiltest .MakeInferenceObjective (infObjective1 .Name ).
69
+ Namespace (pool .Namespace ).
70
+ Criticality (v1alpha2 .Standard ).
71
+ CreationTimestamp (metav1 .Unix (1005 , 0 )).
72
+ PoolName (pool .Name ).
73
+ PoolGroup ("inference.networking.x-k8s.io" ).ObjRef ()
65
74
infObjective2 = utiltest .MakeInferenceObjective ("model2" ).
66
75
Namespace (pool .Namespace ).
67
76
CreationTimestamp (metav1 .Unix (1000 , 0 )).
68
- PoolName (pool .Name ).ObjRef ()
77
+ PoolName (pool .Name ).
78
+ PoolGroup ("inference.networking.k8s.io" ).ObjRef ()
69
79
)
70
80
71
81
func TestInferenceObjectiveReconciler (t * testing.T ) {
@@ -119,6 +129,17 @@ func TestInferenceObjectiveReconciler(t *testing.T) {
119
129
objective : infObjective2 ,
120
130
wantObjectives : []* v1alpha2.InferenceObjective {infObjective1 , infObjective2 },
121
131
},
132
+ {
133
+ name : "Objective deleted due to group mismatch for the inference pool" ,
134
+ objectivessInStore : []* v1alpha2.InferenceObjective {infObjective1 },
135
+ objective : infObjective1DiffGroup ,
136
+ wantObjectives : []* v1alpha2.InferenceObjective {},
137
+ },
138
+ {
139
+ name : "Objective ignored due to group mismatch for the inference pool" ,
140
+ objective : infObjective1DiffGroup ,
141
+ wantObjectives : []* v1alpha2.InferenceObjective {},
142
+ },
122
143
}
123
144
for _ , test := range tests {
124
145
t .Run (test .name , func (t * testing.T ) {
@@ -134,7 +155,6 @@ func TestInferenceObjectiveReconciler(t *testing.T) {
134
155
for _ , m := range test .objectivesInAPIServer {
135
156
initObjs = append (initObjs , m )
136
157
}
137
-
138
158
fakeClient := fake .NewClientBuilder ().
139
159
WithScheme (scheme ).
140
160
WithObjects (initObjs ... ).
0 commit comments