Reputation: 31
I've pushing Docker images to my GitLab Container Registry using a CI pipeline for a while now and I've been using this command to list all repositories (20 repos) inside my registry:
curl --header "PRIVATE-TOKEN: $GITLAB_TOKEN" "$CI_SERVER_PROTOCOL://$CI_SERVER_HOST/api/v4/projects/$PROJECT_ID/registry/repositories"
I've created 5 new repositories using my CI, and I can see all repos in GitLab's interface (25 repos), but the command is only returning 20 repositories.
What could be the reason for this?
Upvotes: 2
Views: 1405
Reputation: 6259
20 is the default number of items to list per page with Gitlab API.
You can either change the number of item per_page
(but the max is 100) or iterate over result using Pagination Link header. Detailed explanation can be found in the documentation.
Upvotes: 3