reference icon indicating copy to clipboard operation
reference copied to clipboard

Repository name regex is outdated [docs].

Open ipanova opened this issue 8 years ago • 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

ipanova avatar Dec 20 '17 09:12 ipanova

i would like too fix this issue

rahul3002 avatar Sep 22 '22 14:09 rahul3002

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

milosgajdos avatar Sep 22 '22 15:09 milosgajdos

yes i want to open

rahul3002 avatar Sep 22 '22 15:09 rahul3002

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

milosgajdos avatar Sep 22 '22 15:09 milosgajdos

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

thaJeztah avatar Sep 22 '22 16:09 thaJeztah

sure will check it, I'm working on it

rahul3002 avatar Sep 23 '22 14:09 rahul3002

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

rahul3002 avatar Sep 24 '22 07:09 rahul3002