@@ -121,7 +121,7 @@ func TestInferencePoolReconciler(t *testing.T) {
121121 if _ , err := inferencePoolReconciler .Reconcile (ctx , req ); err != nil {
122122 t .Errorf ("Unexpected InferencePool reconcile error: %v" , err )
123123 }
124- if diff := diffStore (ds , diffStoreParams {wantPool : pool1 , wantPods : []string {"pod1-rank-0" , "pod2-rank-0" }}); diff != "" {
124+ if diff := diffStore (ds , diffStoreParams {wantPool : pool1 , wantEndpoints : []string {"pod1-rank-0" , "pod2-rank-0" }}); diff != "" {
125125 t .Errorf ("Unexpected diff (+got/-want): %s" , diff )
126126 }
127127
@@ -139,7 +139,7 @@ func TestInferencePoolReconciler(t *testing.T) {
139139 if _ , err := inferencePoolReconciler .Reconcile (ctx , req ); err != nil {
140140 t .Errorf ("Unexpected InferencePool reconcile error: %v" , err )
141141 }
142- if diff := diffStore (ds , diffStoreParams {wantPool : newPool1 , wantPods : []string {"pod5-rank-0" }}); diff != "" {
142+ if diff := diffStore (ds , diffStoreParams {wantPool : newPool1 , wantEndpoints : []string {"pod5-rank-0" }}); diff != "" {
143143 t .Errorf ("Unexpected diff (+got/-want): %s" , diff )
144144 }
145145
@@ -154,7 +154,7 @@ func TestInferencePoolReconciler(t *testing.T) {
154154 if _ , err := inferencePoolReconciler .Reconcile (ctx , req ); err != nil {
155155 t .Errorf ("Unexpected InferencePool reconcile error: %v" , err )
156156 }
157- if diff := diffStore (ds , diffStoreParams {wantPool : newPool1 , wantPods : []string {"pod5-rank-0" }}); diff != "" {
157+ if diff := diffStore (ds , diffStoreParams {wantPool : newPool1 , wantEndpoints : []string {"pod5-rank-0" }}); diff != "" {
158158 t .Errorf ("Unexpected diff (+got/-want): %s" , diff )
159159 }
160160
@@ -168,14 +168,14 @@ func TestInferencePoolReconciler(t *testing.T) {
168168 if _ , err := inferencePoolReconciler .Reconcile (ctx , req ); err != nil {
169169 t .Errorf ("Unexpected InferencePool reconcile error: %v" , err )
170170 }
171- if diff := diffStore (ds , diffStoreParams {wantPods : []string {}}); diff != "" {
171+ if diff := diffStore (ds , diffStoreParams {wantEndpoints : []string {}}); diff != "" {
172172 t .Errorf ("Unexpected diff (+got/-want): %s" , diff )
173173 }
174174}
175175
176176type diffStoreParams struct {
177177 wantPool * v1.InferencePool
178- wantPods []string
178+ wantEndpoints []string
179179 wantObjectives []* v1alpha2.InferenceObjective
180180}
181181
@@ -188,15 +188,15 @@ func diffStore(datastore datastore.Datastore, params diffStoreParams) string {
188188 }
189189
190190 // Default wantPods if not set because PodGetAll returns an empty slice when empty.
191- if params .wantPods == nil {
192- params .wantPods = []string {}
191+ if params .wantEndpoints == nil {
192+ params .wantEndpoints = []string {}
193193 }
194- gotPods := []string {}
195- for _ , pm := range datastore .PodList (backendmetrics .AllPodsPredicate ) {
196- gotPods = append (gotPods , pm . GetPod ().NamespacedName .Name )
194+ gotEndpoints := []string {}
195+ for _ , em := range datastore .PodList (backendmetrics .AllPodsPredicate ) {
196+ gotEndpoints = append (gotEndpoints , em . GetMetadata ().NamespacedName .Name )
197197 }
198- if diff := cmp .Diff (params .wantPods , gotPods , cmpopts .SortSlices (func (a , b string ) bool { return a < b })); diff != "" {
199- return "pods :" + diff
198+ if diff := cmp .Diff (params .wantEndpoints , gotEndpoints , cmpopts .SortSlices (func (a , b string ) bool { return a < b })); diff != "" {
199+ return "endpoints :" + diff
200200 }
201201
202202 // Default wantModels if not set because ModelGetAll returns an empty slice when empty.
@@ -348,8 +348,8 @@ func xDiffStore(t *testing.T, datastore datastore.Datastore, params xDiffStorePa
348348 params .wantPods = []string {}
349349 }
350350 gotPods := []string {}
351- for _ , pm := range datastore .PodList (backendmetrics .AllPodsPredicate ) {
352- gotPods = append (gotPods , pm . GetPod ().NamespacedName .Name )
351+ for _ , em := range datastore .PodList (backendmetrics .AllPodsPredicate ) {
352+ gotPods = append (gotPods , em . GetMetadata ().NamespacedName .Name )
353353 }
354354 if diff := cmp .Diff (params .wantPods , gotPods , cmpopts .SortSlices (func (a , b string ) bool { return a < b })); diff != "" {
355355 return "pods:" + diff
0 commit comments