{"action":"opened","issue":{"url":"https://api.github.com/repos/docker/distribution/issues/1056","labels_url":"https://api.github.com/repos/docker/distribution/issues/1056/labels{/name}","comments_url":"https://api.github.com/repos/docker/distribution/issues/1056/comments","events_url":"https://api.github.com/repos/docker/distribution/issues/1056/events","html_url":"https://github.com/docker/distribution/issues/1056","id":109472746,"number":1056,"title":"double underscore and double hyphen in image names","user":{"login":"adambrett","id":145340,"avatar_url":"https://avatars.githubusercontent.com/u/145340?v=3","gravatar_id":"","url":"https://api.github.com/users/adambrett","html_url":"https://github.com/adambrett","followers_url":"https://api.github.com/users/adambrett/followers","following_url":"https://api.github.com/users/adambrett/following{/other_user}","gists_url":"https://api.github.com/users/adambrett/gists{/gist_id}","starred_url":"https://api.github.com/users/adambrett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adambrett/subscriptions","organizations_url":"https://api.github.com/users/adambrett/orgs","repos_url":"https://api.github.com/users/adambrett/repos","events_url":"https://api.github.com/users/adambrett/events{/privacy}","received_events_url":"https://api.github.com/users/adambrett/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-02T11:08:16Z","updated_at":"2015-10-02T11:08:16Z","closed_at":null,"body":"Hi All,\r\n\r\nI originally raised this issue on the docker repo, but I think this is the more appropriate place.  There was quite a bit of previous discussion there, which for context you can find here: https://github.com/docker/docker/issues/16117\r\n\r\nThe update to the v2 registry api broke backwards comparability in a minor docker version, as the reduced scope for naming disallowed multiple underscore and hyphens in image names.\r\n\r\nI understand the reason for the change, but in order to aid backwards compatibility, I propose allowing double underscore, double hyphen, and double period in image names.\r\n\r\nLooking at the work being done in https://github.com/docker/distribution/pull/963, the change would be fairly trivial.\r\n\r\nAdding the following test cases to `reference/reference_test.go`:\r\n\r\n```go\r\n{\r\n\tinput:      \"test__com\",\r\n\trepository: \"test__com\",\r\n},\r\n{\r\n\tinput:      \"test__com--hello\",\r\n\trepository: \"test__com--hello\",\r\n},\r\n{\r\n\tinput:      \"test.com/test--com\",\r\n\thostname:   \"test.com\",\r\n\trepository: \"test.com/test--com\",\r\n},\r\n{\r\n\tinput:      \"test--a.com/test..com:sometag\",\r\n\thostname:   \"test--a.com\",\r\n\trepository: \"test--a.com/test..com\",\r\n\ttag:        \"sometag\",\r\n},\r\n{\r\n\tinput:      \"test---a\",\r\n\terr:   ErrReferenceInvalidFormat,\r\n},\r\n{\r\n\tinput:      \"test___a\",\r\n\terr:   ErrReferenceInvalidFormat,\r\n},\r\n{\r\n\tinput:      \"test...a\",\r\n\terr:   ErrReferenceInvalidFormat,\r\n},\r\n{\r\n\tinput:      \"test___a.com/test--com:sometag\",\r\n\terr:   ErrReferenceInvalidFormat,\r\n},\r\n```\r\n\r\nwould require the following changes to `reference/regexp.go`:\r\n\r\n```diff\r\n--- a/reference/regexp.go\r\n+++ b/reference/regexp.go\r\n@@ -6,7 +6,7 @@ var (\r\n        // nameComponentRegexp restricts registry path component names to\r\n        // start with at least one letter or number, with following parts able to\r\n        // be separated by one or two period, dash or underscore.\r\n-       nameComponentRegexp = regexp.MustCompile(`[a-zA-Z0-9]+(?:[._-][a-z0-9]+)*`)\r\n+       nameComponentRegexp = regexp.MustCompile(`[a-zA-Z0-9]+(?:[._-]{1,2}[a-z0-9]+)*`)\r\n```\r\nI'm open to suggestions from all parties if you need/want more information, or want me to do more investigation into some aspect of this change, as well as how best to integrate it with the work being done in https://github.com/docker/distribution/pull/963.\r\n\r\nThanks"}}