Issue #1404
closedSync from un-namespaced V2 repository fails
Description
When attempting to sync an un-namespaced repository from a V2 registry, the sync fails with 'Not found'.
With V1 registries there was a default namespace of 'library', so 'docker pull myimage' would really be pulling 'library/myimage'.
I don't believe this to be the case with V2. Wheresa the V1 API was specified in terms of /v1/<namespace>/<repository>/..., the V2 API is specified in terms of /v2/<name>/... .
As a result, when pulp-docker adds the 'library/' prefix, this fails with V2 registries.
Related issues
Updated by mhrivnak about 9 years ago
- Priority changed from Normal to High
- Severity changed from 2. Medium to 3. High
- Target Release - Docker set to 2.0.0
- Triaged changed from No to Yes
Updated by amacdona@redhat.com almost 9 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to amacdona@redhat.com
Updated by amacdona@redhat.com almost 9 years ago
- Blocked by Story #1144: As a user, I can sync from a v2 registry that requires RFC7235 authorization headers added
Updated by amacdona@redhat.com almost 9 years ago
As far as I can tell, /v2/<name/ is the same as the /v1/<namespace>/<repository>. In the case that there is no namespace, Docker hub still hosts the content at library/<repository>, so I am assuming that <name> = <namespace>/<repository>
Neither will correctly work at the moment due to the auth bug, but on the branch that is fixing that:
This will sync correctly:
pulp-admin docker repo create --repo-id=busybox --feed=https://registry-1.docker.io --upstream-name=library/busybox
This will not sync correctly:
pulp-admin docker repo create --repo-id=busybox --feed=https://registry-1.docker.io --upstream-name=busybox
To fix this, we have some options.
1. upstream-name could be required to have a namespace. I this is not ideal, since docker itself doesn't require this and assumes library/<repo> if a namespace is not provided.
2. We can prepend "library/" to self.name here: https://github.com/pulp/pulp_docker/blob/master/plugins/pulp_docker/plugins/registry.py#L290 This would be my preference, but I am unsure if this would have unintended consequences elsewhere. Specifically I am curious why for v1 this is only done in the `get_tags` function. This works with the busybox repo example above.
3. We could prepend "library/" where it is needed. At least get_tags.
Updated by twaugh almost 9 years ago
So, for Docker Hub, adding "library" will work because Docker Hub is special.
For other Distribution instances, or other implementations, adding "library" will not work. "busybox" and "library/busybox" reference different repositories, except as a special case on Docker Hub.
That's what this bug is about: when syncing from a V2 registry, "library" is always added and that is incorrect.
To be clear: correct behaviour would be for pulp_docker to be requesting /v2/busybox/ when upstream-name is busybox. The current incorrect behaviour is that it requests /v2/library/busybox/.
Updated by twaugh almost 9 years ago
See also https://github.com/openshift/origin/issues/6570, where a similar bug was also fixed.
Updated by amacdona@redhat.com almost 9 years ago
- Related to Story #1454: As a user, I can sync v2 content from docker hub added
Updated by amacdona@redhat.com almost 9 years ago
- Assignee changed from amacdona@redhat.com to pcreech
Added by pcreech almost 9 years ago
Added by pcreech almost 9 years ago
Revision 620f8d60 | View on GitHub
Add library namespace to docker hub images
Add library namespace to docker hub registry images that do not have one.
Added by pcreech almost 9 years ago
Revision 620f8d60 | View on GitHub
Add library namespace to docker hub images
Add library namespace to docker hub registry images that do not have one.
Added by pcreech almost 9 years ago
Revision 620f8d60 | View on GitHub
Add library namespace to docker hub images
Add library namespace to docker hub registry images that do not have one.
Updated by pcreech almost 9 years ago
- Status changed from ASSIGNED to POST
Updated by pcreech almost 9 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset 620f8d6031e35ba1debc45cc77d52d1b4387db90.
Updated by amacdona@redhat.com almost 9 years ago
- Status changed from MODIFIED to NEW
- Triaged changed from Yes to No
Reopening due to https://pulp.plan.io/issues/1685.
We probably need to adjust the code that fixed this originally.
Updated by rbarlow almost 9 years ago
Pulp wrote:
Reopening due to https://pulp.plan.io/issues/1685.
We probably need to adjust the code that fixed this originally.
Good catch Austin, I would have forgotten about this!
--
Randy Barlow
irc: bowlofeggs
Updated by amacdona@redhat.com almost 9 years ago
- Status changed from NEW to ASSIGNED
- Assignee changed from pcreech to amacdona@redhat.com
Updated by amacdona@redhat.com almost 9 years ago
There was some behavior change at the dockerhub endpoints, but it turns out that we do not need to change anything on our end as far as namespacing the repos goes.
Updated by amacdona@redhat.com almost 9 years ago
- Status changed from ASSIGNED to MODIFIED
Updated by dkliban@redhat.com almost 9 years ago
- Status changed from MODIFIED to 5
Updated by semyers over 8 years ago
- Status changed from 5 to CLOSED - CURRENTRELEASE
Add library namespace to docker hub images
Add library namespace to docker hub registry images that do not have one.
closes #1404 https://pulp.plan.io/issues/1404