Project

Profile

Help

Issue #1404

closed

Sync from un-namespaced V2 repository fails

Added by twaugh over 8 years ago. Updated about 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Start date:
Due date:
Estimated time:
Severity:
3. High
Version - Docker:
master
Platform Release:
Target Release - Docker:
2.0.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

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

Related to Docker Support - Story #1454: As a user, I can sync v2 content from docker hubCLOSED - CURRENTRELEASEamacdona@redhat.com

Actions
Blocked by Docker Support - Story #1144: As a user, I can sync from a v2 registry that requires RFC7235 authorization headersCLOSED - CURRENTRELEASEamacdona@redhat.com

Actions
Actions #1

Updated by mhrivnak over 8 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
Actions #2

Updated by amacdona@redhat.com about 8 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to amacdona@redhat.com
Actions #3

Updated by amacdona@redhat.com about 8 years ago

  • Blocked by Story #1144: As a user, I can sync from a v2 registry that requires RFC7235 authorization headers added
Actions #4

Updated by amacdona@redhat.com about 8 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.

Actions #5

Updated by twaugh about 8 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/.

Actions #6

Updated by twaugh about 8 years ago

See also https://github.com/openshift/origin/issues/6570, where a similar bug was also fixed.

Actions #7

Updated by amacdona@redhat.com about 8 years ago

  • Related to Story #1454: As a user, I can sync v2 content from docker hub added
Actions #8

Updated by amacdona@redhat.com about 8 years ago

  • Assignee changed from amacdona@redhat.com to pcreech

Added by pcreech about 8 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.

closes #1404 https://pulp.plan.io/issues/1404

Added by pcreech about 8 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.

closes #1404 https://pulp.plan.io/issues/1404

Added by pcreech about 8 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.

closes #1404 https://pulp.plan.io/issues/1404

Added by pcreech about 8 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.

closes #1404 https://pulp.plan.io/issues/1404

Actions #9

Updated by pcreech about 8 years ago

  • Status changed from ASSIGNED to POST
Actions #10

Updated by pcreech about 8 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100
Actions #11

Updated by amacdona@redhat.com about 8 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.

Actions #12

Updated by rbarlow about 8 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

Actions #13

Updated by amacdona@redhat.com about 8 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee changed from pcreech to amacdona@redhat.com
Actions #14

Updated by mhrivnak about 8 years ago

  • Triaged changed from No to Yes
Actions #15

Updated by amacdona@redhat.com about 8 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.

Actions #16

Updated by amacdona@redhat.com about 8 years ago

  • Status changed from ASSIGNED to MODIFIED
Actions #17

Updated by dkliban@redhat.com about 8 years ago

  • Status changed from MODIFIED to 5
Actions #18

Updated by semyers almost 8 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE
Actions #19

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF