Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

hub.Repositories() return s error if there are more repository than fetched per page #82

Open
daolis opened this issue Feb 10, 2021 · 2 comments · May be fixed by #83 or #88
Open

hub.Repositories() return s error if there are more repository than fetched per page #82

daolis opened this issue Feb 10, 2021 · 2 comments · May be fixed by #83 or #88

Comments

@daolis
Copy link

daolis commented Feb 10, 2021

registry.getPaginatedJSON(url, &response) in registry.repositories uses
a URL including protocol, and base URL at the fist call and fetches the list of repositories correctly.
e.g. url = https://myrepository/v2/_catalog

BUT it returns the URL to fetch the next page without the base URL
e.g. /v2/_catalog?last=something&n=100&orderby=

next call to registry.getPaginatedJSON(url, &response) return an error: unsupported protocol scheme ""

I guess the same error will happen for Tags (registry.repositories)

@yosensen
Copy link

yosensen commented Apr 8, 2021

registry.getPaginatedJSON(url, &response) in registry.repositories uses
a URL including protocol, and base URL at the fist call and fetches the list of repositories correctly.
e.g. url = https://myrepository/v2/_catalog

BUT it returns the URL to fetch the next page without the base URL
e.g. /v2/_catalog?last=something&n=100&orderby=

next call to registry.getPaginatedJSON(url, &response) return an error: unsupported protocol scheme ""

I guess the same error will happen for Tags (registry.repositories)

I fixed it on func (registry *Registry) Repositories() ([]string, error) in repositories.go with

url = strings.ReplaceAll(url, "%", "%%")
url = registry.url(url)

after

url, err = registry.getPaginatedJSON(url, &response)

Maybe the Tags can be fixed with the same way.

@yosensen yosensen linked a pull request Apr 8, 2021 that will close this issue
@annelau21
Copy link

Bump on this issue - do we know if there is a work-around?

cuisongliu added a commit to cuisongliu/sealos that referenced this issue Nov 7, 2022
cuisongliu added a commit to labring/sealos that referenced this issue Nov 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants