How to list paginated image tags from quay.io using regctl

1.3k Views Asked by At

Regctl provides - among other things - a CLI for listing image tags available on a registry, but when the image has a lot of tags, pagination gets in the way.

The problem is that so far I've not found a way to obtain other than the 1st 50 tags on quay.io. i.e. if I get tags for calico/node image from dockerhub I get

/tmp$ regctl tag ls calico/node | wc -l
8225

but when it comes to quay.io it seems to return just the first 50 tags, that is why regctl provides a specific flag (from regctl tag ls --help)

--last string     Specify the last tag from a previous request for pagination

but the --last param seems not working on quay as regctl seems to return the very same contents as when invoked without the flag

/tmp$ regctl tag ls quay.io/calico/node | wc -l
50
/tmp$ regctl tag ls quay.io/calico/node | tail -n 3
v3.4.0-0.dev-27-g319e739-ppc64le
v3.4.0-0.dev-28-g909229b-amd64
v3.4.0-0.dev-28-g909229b-arm64
/tmp$ regctl tag ls quay.io/calico/node --last 'v3.4.0-0.dev-28-g909229b-arm64' | tail -n 3
v3.4.0-0.dev-27-g319e739-ppc64le
v3.4.0-0.dev-28-g909229b-amd64
v3.4.0-0.dev-28-g909229b-arm64
1

There are 1 best solutions below

2
On

The parameter is working, but only kinda:

$ regctl tag ls quay.io/calico/node --last v3.3.0-4-g70e7d79-ppc64le --limit 5
v3.3.0-2-g441d7c2-arm64
v3.4.0-0.dev-25-g17db8bd
v3.4.0-0.dev-25-g17db8bd-amd64
v3.4.0-0.dev-25-g17db8bd-arm64
v3.4.0-0.dev-25-g17db8bd-ppc64le

Something that jumps out there is that the last tag is included in the new list, which isn't valid from the OCI spec. Instead, the results should look like what Hub does:

$ regctl tag ls calico/node  --limit 10
06d8348
0b3286c-e9613934-1eb2608
2606b97-e0ce0bc-7a66b57
2606b97-e0ce0bca-7a66b57
383a737
43b069c
4d0d1ec
4fac26c-0ff3c42a-f442384
53afe8a
542c040

$ regctl tag ls calico/node  --limit 10 --last 542c040
684ef2b
6889069
69c3089
6ce4f0a
714dda5-36dc8f6f-aa95469
714dda5-48a4a83d-aa95469
714dda5-6af11396-aa95469
765dc25
91d54c3
9512289

I've also noticed when I increase the limit, I'll start seeing entries returned from even further before the "last" entry that I requested, and it's using a previous "last" parameter for these offsets. Most likely it's some weird caching happening, which is documented in this Jira issue. For right now, it appears that Quay is not following the OCI distribution-spec which makes this difficult to test and use, and will need to be fixed by Quay.