Skip to content

fix(core): propagate filterQuery in GetInferenceServices and GetServeModels - #3208

Merged
google-oss-prow[bot] merged 1 commit into
kubeflow:mainfrom
vjkumar2756:fix/inference-services-serve-models-filter-query
Sep 12, 2026
Merged

fix(core): propagate filterQuery in GetInferenceServices and GetServeModels#3208
google-oss-prow[bot] merged 1 commit into
kubeflow:mainfrom
vjkumar2756:fix/inference-services-serve-models-filter-query

Conversation

@vjkumar2756

@vjkumar2756 vjkumar2756 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Close #3207

Problem & Root Cause

Problem

When querying GET /inference_services?filterQuery=... or GET /serve_models?filterQuery=..., the backend silently ignores the filterQuery parameter and returns all records unfiltered without raising any validation error.

Root Cause

  1. Omitted Field Forwarding: In internal/core/inference_service.go (GetInferenceServices) and internal/core/serve_model.go (GetServeModels), the Pagination struct initialization copied PageSize, OrderBy, SortOrder, and NextPageToken from api.ListOptions, but left out FilterQuery.
  2. Missing Interface Implementation: The database filtering engine uses ApplyFilterQuery(), which requires list options to implement the FilterApplier interface. InferenceServiceListOptions in internal/db/models/inference_service.go was missing the GetRestEntityType() method, causing ApplyFilterQuery() to silently skip filtering.

What Changed?

1. internal/db/models/inference_service.go

Implemented FilterApplier on InferenceServiceListOptions:

// GetRestEntityType implements the FilterApplier interface.
func (i *InferenceServiceListOptions) GetRestEntityType() filter.RestEntityType {
    return filter.RestEntityInferenceService
}

@pboyd pboyd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ok-to-test

@pboyd pboyd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@vjkumar2756
vjkumar2756 force-pushed the fix/inference-services-serve-models-filter-query branch from 7436be8 to e2c82af Compare September 11, 2026 22:04
@vjkumar2756

vjkumar2756 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review @pboyd
Just to clarify, I found the issue myself after seeing a similar problem in another project and checking whether it existed here. I used AI as a supporting tool for confirmation, debugging, and checking the implementation, but the issue identification and investigation were my own.

I have amended the commit to include the Assisted by : disclosure trailer and force pushed the branch.
Ready for merge! I am also happy to explain how I identified the issue and worked through the fix.
Thanks again for the feedback.

@vjkumar2756
vjkumar2756 requested a review from pboyd September 11, 2026 22:17
@pboyd

pboyd commented Sep 12, 2026

Copy link
Copy Markdown
Member

Thanks, @vjkumar2756.

/ok-to-test
/lgtm
/approve

@google-oss-prow

Copy link
Copy Markdown
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow
google-oss-prow Bot merged commit e43c096 into kubeflow:main Sep 12, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

filterQuery parameter silently ignored on GET / inference_services and GET / serve_models endpoints

2 participants