Container Registry is only showing 100 tags per image
Summary
When pushing more than 100 tags for one image in the container registry, the tag count will stay at 100.
The tag list is also limited to 100 tags – when there's more than 100 images, you'll only be able to browse through exactly ten pages with ten tags each.
Those 100 tags appear to be the same even when changing sorting direction, presumably as sorting is done after receiving the data.
The tags in question are in the registry and can be pulled successfully.
Side note: While trying to find an existing issue for this particular behavior, we noticed that the same limit of 100 tags per image was chosen for Migrate Free tier images (#350920 - closed)
Steps to reproduce
- Create new project
- Push more than 100 tags for one image to Container Registry (see script below)
- Observe "100" as the tag count and being unable to view some tags
#!/bin/bash
for i in {1..105}
do
docker build -t registry.gitlab.com/manuelgrabowski/registry-test:$i .
docker push registry.gitlab.com/manuelgrabowski/registry-test:$i
done
Example Project
https://gitlab.com/manuelgrabowski/registry-test/container_registry/2920556
What is the current bug behavior?
Only 100 tags are shown in the UI.
What is the expected correct behavior?
All tags are shown in the UI.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Possible fixes
We believe the reason for this to be that pagination has been implemented in the Container Registry fork, but is not yet being used for this UI. Implementing the existing issue Container Registry Tags API to support pagination (#325760 - closed) would likely fix this problem as well.
const maximumReturnedEntries = 100
is defined in catalog.go#L19 and appears to be used by GetTags
in tags.go#L86.
We believe the above code to be what responds to a /v2/<project>/tags/list
API call. This call is made from the Rails app in repository_tags
client.rb#L55-57, which is called from manifest
container_repository.rb#L358, finally leading us to tags_count
in container_repository.rb#L371-375