Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing SHA256 manifests from the tag listing #89

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Dramelac
Copy link
Contributor

@Dramelac Dramelac commented Jan 3, 2025

Official Docker registry doesn't list raw SHA256 manifest (cf. https://docker-docs.uclv.cu/registry/spec/api/#listing-image-tags). Tested on registry-1.docker.io.
In the current version of the serverless-registry, tag listing return tags but also sha256:[...] manifests that should be excluded.

I didn't find a way to directly query R2 with a more advance filter to exclude the sha256 manifest.
Instead I had to add a filter to remove them and a loop to find more tags until the n number of result are reach.

Bonus:

  • I've also added a condition to only accept n > 0 to avoid any crash from the registry
  • Now the Link for the next page is only supplied to the client if there is more result to fetch

@gabivlj
Copy link
Collaborator

gabivlj commented Jan 3, 2025

We will need to run prettier and do some changes on the unit tests for these changes. Thanks for the contribution!

@Dramelac
Copy link
Contributor Author

Dramelac commented Jan 3, 2025

It should be good now, I've added tests to check if the SHA256 manifest are NOT included in the tag listing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants