Skip to content

Add support for colon as a name-segment delimiter. - #483

Closed
mattmoor wants to merge 1 commit into
distribution:masterfrom
mattmoor:master
Closed

mattmoor wants to merge 1 commit into
distribution:masterfrom
mattmoor:master

Conversation

@mattmoor

@mattmoor mattmoor commented May 2, 2015

Copy link
Copy Markdown
Contributor

This proposed change relaxes the character restrictions on a repository namespace (further) to allow for colon as a name-segment delimiter in addition to dot, colon, and underscore.

For example, on Google's Cloud, we allow domain-scoped namespaces (e.g. moore.com:matt), which enables enterprise customers to have a namespace prefix under which all possible names belong to them.

An alternative approach to this one (of changing the canonical registry) would be to simply enable registries to have provider-specific validation, and simply avoid (or make quite liberal) the client-side validation and wording in the v2 API spec.

Happy to discuss how best to accommodate our use case.

This proposed change relaxes the character restrictions on a repository namespace (further) to allow for colon as a name-segment delimiter in addition to dot, colon, and underscore.

On Google's Cloud, we allow domain-scoped namespaces (e.g. google.com:foo), which enables enterprise customers to have a namespace over which they have full control.

Signed-off-by: Matt Moore <[email protected]>
@dmp42

dmp42 commented May 3, 2015

Copy link
Copy Markdown
Contributor

Isn't this going to make tags parsing more complex then?

@mattmoor

mattmoor commented May 3, 2015

Copy link
Copy Markdown
Contributor Author

Howso? Given the position in the grammar, the allowance for ':' seems unambiguous with the ':' for expressing a tag.

@mattmoor

mattmoor commented May 3, 2015

Copy link
Copy Markdown
Contributor Author

@dmp42 How would you feel about relaxing the client code to defer to the registry about character restrictions? The more I think about it, the more I like it.

The client would maintain a very loose set of restrictions (e.g. interpretation of '/'-delimited parts), but the client would surface potentially rich diagnostic information from the registry when it returns a 400 Bad Request.

In the 1.6 client, if I make the registry return a 400 with body: Invalid namespace: "XYZ", the client reports:

$ docker push localhost:8080/foo/bar:baz
The push refers to a repository [localhost:8080/foo/bar] (len: 1)
Sending image list
FATA[0000] Error: Status 400 trying to push repository foo/bar: "Invalid Namespace: \"foo\"" 

This gives the registry provider much greater freedom over acceptable names, which may be more or less restrictive depending on the underlying storage system.

What do you think? Who would have to sign off on this?

@dmp42

dmp42 commented May 3, 2015

Copy link
Copy Markdown
Contributor

@mattmoor my point is barely that docker pull foo/bar:tag would then be ambiguous, since that can be either the bar:tag image, or the bar image for tag tag.

About suggesting a change like this, I would start a discussion on https://github.com/docker/docker.

@mattmoor

mattmoor commented May 4, 2015

Copy link
Copy Markdown
Contributor Author

I see your point, my intent was to allow ":" in the namespace portion, which would be unambiguous, but v2 blurs the lines between the namespace and image portions, opting for a more directory-like nesting.

I agree this change makes image:tag parsing ambiguous since the same character restrictions apply to both namespace and image. This is my mistake.

I'll send a proposal to discuss lazy validation on the main project. thanks.

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

Successfully merging this pull request may close these issues.

3 participants