-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable search using pagination #964
Conversation
docker/docker_client.go
Outdated
Path: "/v2/_catalog", | ||
} | ||
q := u.Query() | ||
q.Set("n", strconv.Itoa(limit)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does limit get set to 100 if not specified by the user?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Podman search can limit this to its default number of result 25. https://github.com/containers/libpod/blob/3eb0ad04a8b1d56866a16f1428bb8019927ccfa3/libpod/image/search.go#L136-L139
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The
limit
parameter is supposed to be a limit on the number of results, not on the number of values that will be checked for matches. - The linked bug asks for support of pagination, not just for controlling the number of results.
The linked bug expected to receive the total result if the total number of results when there are over 100. |
No; “pagination” means that a single HTTP request only returns up to N results (a “page”), and the client must make another HTTP request for another page, and yet another for the third page, and so on. See https://github.com/docker/distribution/blob/master/docs/spec/api.md#pagination , and |
(The page size is ultimately decided by the server, which just won’t return larger pages than some internally-decided number. It doesn’t need to be a number specified by Podman, and especially users should not have to care.) |
If the user cares about page size then they can pipe it to less. |
The “page” size from the API is completely unrelated to the end-user UI, first of all because the “pages” apply to the full catalog but we only return results of the search in that catalog. |
b521ffe
to
5f809f9
Compare
@mtrmac @vrothberg @TomSweeneyRedHat @rhatdan PTAL. This uses the pagination until the search result reaches the limit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one nit.
Enable search registry uses the pagination until the search result reaches the limit, instead of returning default 100 limit from registry API. BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1827794 Signed-off-by: Qi Wang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Signed-off-by: Qi Wang <[email protected]>
Backports containers#964 to v5.1 Enable search registry uses the pagination until the search result reaches the limit, instead of returning default 100 limit from registry API. BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1866153 Signed-off-by: Qi Wang <[email protected]>
Backports containers#964 to v5.5.1 Enable search registry uses the pagination until the search result reaches the limit, instead of returning default 100 limit from registry API. BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1866153 Signed-off-by: Qi Wang <[email protected]>
Backports pagination fix containers#964 to release-5.5 Enable search registry uses the pagination until the search result reaches the limit, instead of returning default 100 limit from registry API. BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1866153 Signed-off-by: Qi Wang <[email protected]>
Backports pagination fix containers#964 to release-5.5 Use skopeo branch release-1.1 Enable search registry uses the pagination until the search result reaches the limit, instead of returning default 100 limit from registry API. BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1866153 Signed-off-by: Qi Wang <[email protected]>
Backports pagination fix containers#964 to release-5.5 Use skopeo branch release-1.1 Enable search registry uses the pagination until the search result reaches the limit, instead of returning default 100 limit from registry API. BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1866153 Signed-off-by: Qi Wang <[email protected]> Signed-off-by: Miloslav Trmač <[email protected]>
Enable search registry specifying the number of results rather than using default API 100 limit.
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1827794
Signed-off-by: Qi Wang [email protected]