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

Add argument for amount of entries to request from catalog (fixes #112) #113

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sandelinos
Copy link

@Sandelinos Sandelinos commented Jun 5, 2023

fixes #112

@nmapx
Copy link

nmapx commented Aug 5, 2023

@andrey-pohilko can it be merged?

@ipavlushin
Copy link
Collaborator

ipavlushin commented Aug 8, 2023

@nmapx @Sandelinos These changes might break existing use cases for users. I'd like to keep 10000 as the default value and configure it if necessary. Could you also add a section about entries argument to the Readme?

@Elbandi
Copy link

Elbandi commented Aug 11, 2023

You sould add some pagination for listing images: https://docs.docker.com/registry/spec/api/#pagination

@Elbandi
Copy link

Elbandi commented Aug 11, 2023

ok, here is my tiny solution:

    def list_images(self):
        images = []
        last = ""

        while True:
            result = self.send('/v2/_catalog?n=10&last=' + last)
            if result is None:
                return images
            repos = json.loads(result.text)['repositories']
            if len(repos) == 0:
                break
            images += repos
            last = repos[-1]

        return images

@shrinidhi111
Copy link

@nmapx @Sandelinos These changes might break existing use cases for users. I'd like to keep 10000 as the default value and configure it if necessary. Could you also add a section about entries argument to the Readme?

I understand your intention to keep it backward compatible but keeping it at 10k would mean it would break for everyone using the latest registry.

I think @Elbandi suggestion is the way to go

@ilya-sha
Copy link

@andrey-pohilko
Can this be merged?
I have this exact problem and the fix works for me

@andrey-pohilko
Copy link
Owner

@andrey-pohilko Can this be merged? I have this exact problem and the fix works for me

please use code suggested by @Elbandi . would be great if you prepare a new merge request with these changes

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.

registry-cli doesn't work with registry 2.8.2
7 participants