Open trentm opened 7 years ago
So this has bitten us a few times with our internal tools. We end up with more than 50 tags for an image (happens easily because each feature branch is a new tag) and our internal build tools stop working, everyone is confused until someone who's been around for awhile realizes what's going on and deletes some old tags. It'd be great if this could get addressed. 👍
I think this issue has been resolved? Like I can get all the tags of a node repository with over 2000+ tags
Update: Nvm it indeed does not support pagination. AWS ECR defaults returns 100 tags and the response header is not followed
The Docker Registry v2 API's endpoint to list tags is paginated: https://docs.docker.com/registry/spec/api/#tags-paginated This module's
listTags
doesn't yet support that.Currently that is resulting in the "listTags" test in "v2.quayio.test.js" to fail, because the repo used for the test (quay.io/coreos/etcd) now has more than 50 tags (which I guess in quay.io's default page size). Here is some instrumented output from that failing test:
Note that Link header:
link: '<https://quay.io/v2/coreos/etcd/tags/list?next_page=gAAAAABYF4XlRL00UY6caJ4wGdywTryh8c_MpJfbRTEhQ6e-X4D9MnzHxe0V6UbhxqtGJBqjOvo8_LSmCqOccyvjPs8T4rR0Sw%3D%3D&n=50>; rel="next"',
From the spec link above:
So we have an inconsistency between the spec and practice (which has happened before). This might need some poking around to get right.
(Currently AFAICT, Triton doesn't use this
listTags
endpoint, so I don't have an immediate burning need to implement this.)Suggestion:
RegistryClientV2.prototype.listTags = function listTags(cb)
change to optionally take a firstopts
arg. However for compat we can't require it.listTags
change to fetch all tags (following the "Link" url as required).opts.n
to allow setting the page size (though really I don't see a great need for making this configurable).