distribution/reference

Repository name regex is outdated [docs].

ipanova opened this issue · 7 comments

Please update the regex mentioned in docs because it is outdated.
https://docs.docker.com/registry/spec/api/#overview

A repository name is broken up into path components. A component of a repository name must be at least one lowercase, alpha-numeric characters, optionally separated by periods, dashes or underscores. More strictly, it must match the regular expression [a-z0-9]+(?:[._-][a-z0-9]+)*.

Now multiple dashes and double underscore is allowed.
https://github.com/docker/distribution/blob/master/reference/regexp.go#L18

I used the go playground which gave me as an output this regex [a-z0-9]+(?:(?:(?:[._]|__|[-]*)[a-z0-9]+)+)?

https://play.golang.org/p/wQ4w431jvS

i would like too fix this issue

@rahul3002 do you want to open a PR that fixes this?

yes i want to open

Please, be our guest -- we welcome contributions :)

Before we change; please double check if the regex in code matches the actual specification; in case there's a bug in the code; https://github.com/opencontainers/distribution-spec/blob/main/spec.md#pulling-manifests

sure will check it, I'm working on it

I'm unable to understand what kind of regex u want to update In it