Bug 1866153

Summary: podman search doesn't add limit to a query against v2. By default v2 returns 100 items.
Product: Red Hat Enterprise Linux 8 Reporter: Robin Cernin <rcernin>
Component: podmanAssignee: Jindrich Novy <jnovy>
Status: CLOSED ERRATA QA Contact: atomic-bugs <atomic-bugs>
Severity: low Docs Contact:
Priority: unspecified    
Version: 8.2CC: bbaude, dwalsh, jligon, jnovy, lsm5, m.andre, mheon, qiwan, tsweeney, vrothber, ypu, yujiang
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: podman-2.0.5 or newer Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 03:06:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1872263    
Bug Blocks:    

Description Robin Cernin 2020-08-05 02:30:26 UTC
Description of problem:

Podman uses docker.SearchRegistry from older version of docker_client.go

github.com/containers/image/v5/docker/docker_client.go

Which doesn't add limit to a query against v2. By default v2 returns 100 items. 


The issue can be seen with:

curl http://localhost:5000/v2/_catalog will return 100 PerPage

VS

curl http://localhost:5000/v2/_catalog?n=1000 will return 1000 PerPage

podman search --limit 1000 doesn't add ?n=1000 to a search query and hence API always returns 100 even with limit set to 1000.


Additional info:

Latest podman from github.com

Comment 1 Tom Sweeney 2020-08-05 18:31:21 UTC
Assigning to Qi as she worked on the limit code a few months ago.  I seem to remember there being a hard limit of 100 for the registries.  Qi do you recall?  Perhaps we can bump the limit on search if going against a v2 registry if we're limited in v1 registries?

Comment 2 Qi Wang 2020-08-05 18:46:47 UTC
https://github.com/containers/image/commit/4c0f8a70e6a8401b606e2aa407f3502de2f02521 supports the pagination in containers/image. I didn't see this be imported to podman to enable getting rid of the 100 limit.

Comment 10 Jindrich Novy 2020-08-26 06:55:24 UTC
Tom, I'm still unsure the backport is present in podman-2.0.5. Once clear I can apply for exception to include this bug in the advisory.

Qi, is the backport present in podman-2.0.5?

Comment 19 errata-xmlrpc 2020-11-04 03:06:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: container-tools:rhel8 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:4694