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

Why dont't using reference.Path(named) instead of named.Name() when building registry v2 API URLs #14

Open
lesomnus opened this issue Nov 26, 2022 · 0 comments

Comments

@lesomnus
Copy link

I understand that reference.Named may not contains the domain part according to its implementation. However, the
function ParseNamed(s string) (Named, error) requires given s to be canonical which conatins the domain part.

Assume that we have reference.Named that holds "cr.io/foo/bar" where domain is "cr.io". The URL build functions such as (ub *URLBuilder) BuildTagsURL(name reference.Named, values ...url.Values)
generates URL "/v2/cr.io/foo/bar" but it must be "/v2/foo/bar".

How about replacing all named.Name() in distribution/registry/api/v2/url.go into reference.Path(named) to give its intention? Or how about remvoe domain part from the argument inNewRepository(name reference.Named, baseURL string, transport http.RoundTripper) to prevent misintended result?

If the current implementation (using named.Name()) is intended, can you explain why it is? If not, please tell me which of the above two methods would be better. I will make PR for this (I think the former way is better).

@milosgajdos milosgajdos transferred this issue from distribution/distribution May 27, 2024
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

No branches or pull requests

1 participant