@@ -123,7 +123,7 @@ func TestInferencePoolReconciler(t *testing.T) {
123123 t .Errorf ("Unexpected InferencePool reconcile error: %v" , err )
124124 }
125125 endpointPool1 := pool .InferencePoolToEndpointPool (pool1 )
126- if diff := diffStore (ds , diffStoreParams {wantPool : endpointPool1 , wantPods : []string {"pod1-rank-0" , "pod2-rank-0" }}); diff != "" {
126+ if diff := diffStore (ds , diffStoreParams {wantPool : endpointPool1 , wantEndpoints : []string {"pod1-rank-0" , "pod2-rank-0" }}); diff != "" {
127127 t .Errorf ("Unexpected diff (+got/-want): %s" , diff )
128128 }
129129
@@ -141,7 +141,7 @@ func TestInferencePoolReconciler(t *testing.T) {
141141 t .Errorf ("Unexpected InferencePool reconcile error: %v" , err )
142142 }
143143 newEndpointPool1 := pool .InferencePoolToEndpointPool (newPool1 )
144- if diff := diffStore (ds , diffStoreParams {wantPool : newEndpointPool1 , wantPods : []string {"pod5-rank-0" }}); diff != "" {
144+ if diff := diffStore (ds , diffStoreParams {wantPool : newEndpointPool1 , wantEndpoints : []string {"pod5-rank-0" }}); diff != "" {
145145 t .Errorf ("Unexpected diff (+got/-want): %s" , diff )
146146 }
147147
@@ -157,7 +157,7 @@ func TestInferencePoolReconciler(t *testing.T) {
157157 t .Errorf ("Unexpected InferencePool reconcile error: %v" , err )
158158 }
159159 newEndpointPool1 = pool .InferencePoolToEndpointPool (newPool1 )
160- if diff := diffStore (ds , diffStoreParams {wantPool : newEndpointPool1 , wantPods : []string {"pod5-rank-0" }}); diff != "" {
160+ if diff := diffStore (ds , diffStoreParams {wantPool : newEndpointPool1 , wantEndpoints : []string {"pod5-rank-0" }}); diff != "" {
161161 t .Errorf ("Unexpected diff (+got/-want): %s" , diff )
162162 }
163163
@@ -171,14 +171,14 @@ func TestInferencePoolReconciler(t *testing.T) {
171171 if _ , err := inferencePoolReconciler .Reconcile (ctx , req ); err != nil {
172172 t .Errorf ("Unexpected InferencePool reconcile error: %v" , err )
173173 }
174- if diff := diffStore (ds , diffStoreParams {wantPods : []string {}}); diff != "" {
174+ if diff := diffStore (ds , diffStoreParams {wantEndpoints : []string {}}); diff != "" {
175175 t .Errorf ("Unexpected diff (+got/-want): %s" , diff )
176176 }
177177}
178178
179179type diffStoreParams struct {
180180 wantPool * datalayer.EndpointPool
181- wantPods []string
181+ wantEndpoints []string
182182 wantObjectives []* v1alpha2.InferenceObjective
183183}
184184
@@ -189,15 +189,15 @@ func diffStore(datastore datastore.Datastore, params diffStoreParams) string {
189189 }
190190
191191 // Default wantPods if not set because PodGetAll returns an empty slice when empty.
192- if params .wantPods == nil {
193- params .wantPods = []string {}
192+ if params .wantEndpoints == nil {
193+ params .wantEndpoints = []string {}
194194 }
195- gotPods := []string {}
196- for _ , pm := range datastore .PodList (backendmetrics .AllPodsPredicate ) {
197- gotPods = append (gotPods , pm . GetPod ().NamespacedName .Name )
195+ gotEndpoints := []string {}
196+ for _ , em := range datastore .PodList (backendmetrics .AllPodsPredicate ) {
197+ gotEndpoints = append (gotEndpoints , em . GetMetadata ().NamespacedName .Name )
198198 }
199- if diff := cmp .Diff (params .wantPods , gotPods , cmpopts .SortSlices (func (a , b string ) bool { return a < b })); diff != "" {
200- return "pods :" + diff
199+ if diff := cmp .Diff (params .wantEndpoints , gotEndpoints , cmpopts .SortSlices (func (a , b string ) bool { return a < b })); diff != "" {
200+ return "endpoints :" + diff
201201 }
202202
203203 // Default wantModels if not set because ModelGetAll returns an empty slice when empty.
@@ -343,8 +343,8 @@ func xDiffStore(datastore datastore.Datastore, params xDiffStoreParams) string {
343343 params .wantPods = []string {}
344344 }
345345 gotPods := []string {}
346- for _ , pm := range datastore .PodList (backendmetrics .AllPodsPredicate ) {
347- gotPods = append (gotPods , pm . GetPod ().NamespacedName .Name )
346+ for _ , em := range datastore .PodList (backendmetrics .AllPodsPredicate ) {
347+ gotPods = append (gotPods , em . GetMetadata ().NamespacedName .Name )
348348 }
349349 if diff := cmp .Diff (params .wantPods , gotPods , cmpopts .SortSlices (func (a , b string ) bool { return a < b })); diff != "" {
350350 return "pods:" + diff
0 commit comments