fix(core): propagate filterQuery in GetInferenceServices and GetServeModels - #3208
Conversation
pboyd
left a comment
There was a problem hiding this comment.
Thanks for the fix, @vjkumar2756. It looks good.
This appears to be AI-generated, which is absolutely fine, but it needs a disclosure per Kubeflow's policy. If you can amend the commit with Assisted-by or Co-authored-by line and force push the branch, we can merge it. (And, if I'm wrong about it being AI-generated, just let me know).
…Models Assisted-by: Gemini AI <noreply@google.com> Signed-off-by: Vijay <vjkumar2756@gmail.com>
7436be8 to
e2c82af
Compare
|
Thanks for the review @pboyd I have amended the commit to include the Assisted by : disclosure trailer and force pushed the branch. |
|
Thanks, @vjkumar2756. /ok-to-test |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pboyd The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Close #3207
Problem & Root Cause
Problem
When querying
GET /inference_services?filterQuery=...orGET /serve_models?filterQuery=..., the backend silently ignores thefilterQueryparameter and returns all records unfiltered without raising any validation error.Root Cause
internal/core/inference_service.go(GetInferenceServices) andinternal/core/serve_model.go(GetServeModels), thePaginationstruct initialization copiedPageSize,OrderBy,SortOrder, andNextPageTokenfromapi.ListOptions, but left outFilterQuery.ApplyFilterQuery(), which requires list options to implement theFilterApplierinterface.InferenceServiceListOptionsininternal/db/models/inference_service.gowas missing theGetRestEntityType()method, causingApplyFilterQuery()to silently skip filtering.What Changed?
1.
internal/db/models/inference_service.goImplemented
FilterApplieronInferenceServiceListOptions: