Issue #3118
closed
cannot create docker repository with repo-registry-id containing "--" or "__"
Status:
CLOSED - CURRENTRELEASE
Description
pulp-admin docker repo create --repo-id=docker-foo6 --repo-registry-id="foo--foo"
A validation error occurred.
The value specified for repo-registry-id: 'foo--foo' is invalid. Registry id
must contain only lower case letters, integers, hyphens, periods, and may
include a single slash.
This worked on pulp 2.8, but is no longer working. Ina blamed this commit for breaking it: https://github.com/pulp/pulp_docker/commit/c9cce34beef567d3a37048e04e8e7c20ff7d9ddc
I commented on the BZ but perhaps discussion here is better.
Due to previous versions of katello having names that will violate this regexp, perhaps the best solution is to make the validation optional. It could be on by default in pulp itself but overridden by katello. In this way katello could optionally and incrementally enforce validation in its frontend. (Going forward, some way to better customize the registry names is needed by katello.)
- Priority changed from Normal to High
- Sprint/Milestone set to 47
- Triaged changed from No to Yes
from irc discussion:
(04:59:43 PM) ipanova: asmacdo: we have 2 options 1) be close as possible to docker specs, but because previously he had a bug which allowed more things and was not matching docker specs some of the repos would break after the upgrade 2) we relax validation to how it was previously but we are not conform docker specs.
(05:32:49 PM) mhrivnak: Is there discussion or reference somewhere about how allow "--" was a bug?
(05:50:18 PM) ipanova: it was a bug because we had wrong regexpr not conforming docker specs of which we came aware just now
- Sprint/Milestone changed from 47 to 48
I did some more research, unfortunately we will need to match the exact regexp specified in the docker specs, otherwise the client will just refuse to pull from such repos. This is a requirement for v2 protocol and it should be followed because this regexp is used in docker registry api same for docker client code.
Update:
i looked into the docker code, turns out they changed the regexp without updating the docs.
https://github.com/docker/distribution/commit/6bd5b8c24e66ba67a54541d72f1ad8d5cc17e677#diff-1a3e973fb67c04d3672d188529c6afcdR14
I disabled the validation in pulp, and checked that the client with docker pull is able to fetch from repositories:
foo-foo
foo--foo
foo_foo
foo__foo
I hope you won't need to use triple underscore because that does not work.
docker pull localhost:1234/aaa___aaa
Error parsing reference: "localhost:1234/aaa___aaa" is not a valid repository/tag
Next steps:
1) update regexp in pulp to match the one i found in the docker CODE
2) as a bonus report a docs issue to docker/distribution so they would update the docs and not confuse poor people
- Status changed from NEW to ASSIGNED
- Assignee set to ipanova@redhat.com
- Sprint/Milestone changed from 48 to 52
- Status changed from ASSIGNED to POST
- Status changed from POST to MODIFIED
- Platform Release set to 2.15.1
- Status changed from MODIFIED to 5
- Status changed from 5 to CLOSED - CURRENTRELEASE
- Sprint/Milestone deleted (
52)
Also available in: Atom
PDF
Update regexp so it would allow repeated dash and double underscore.
closes #3118 https://pulp.plan.io/issues/3118