Project

Profile

Help

Issue #1404

Sync from un-namespaced V2 repository fails

Added by twaugh almost 5 years ago. Updated over 1 year 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 - CURRENTRELEASE

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Blocked by Docker Support - Story #1144: As a user, I can sync from a v2 registry that requires RFC7235 authorization headersCLOSED - CURRENTRELEASE

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision 620f8d60 View on GitHub
Added by pcreech over 4 years ago

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

Revision 620f8d60 View on GitHub
Added by pcreech over 4 years ago

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

Revision 620f8d60 View on GitHub
Added by pcreech over 4 years ago

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

Revision 620f8d60 View on GitHub
Added by pcreech over 4 years ago

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

History

#1 Updated by mhrivnak almost 5 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

#2 Updated by amacdona@redhat.com over 4 years ago

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

#3 Updated by amacdona@redhat.com over 4 years ago

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

#4 Updated by amacdona@redhat.com over 4 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.

#5 Updated by twaugh over 4 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/.

#6 Updated by twaugh over 4 years ago

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

#7 Updated by amacdona@redhat.com over 4 years ago

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

#8 Updated by amacdona@redhat.com over 4 years ago

  • Assignee changed from amacdona@redhat.com to pcreech

#9 Updated by pcreech over 4 years ago

  • Status changed from ASSIGNED to POST

#10 Updated by pcreech over 4 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100

#11 Updated by amacdona@redhat.com over 4 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.

#12 Updated by rbarlow over 4 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

#13 Updated by amacdona@redhat.com over 4 years ago

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

#14 Updated by mhrivnak over 4 years ago

  • Triaged changed from No to Yes

#15 Updated by amacdona@redhat.com over 4 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.

#16 Updated by amacdona@redhat.com over 4 years ago

  • Status changed from ASSIGNED to MODIFIED

#17 Updated by dkliban@redhat.com over 4 years ago

  • Status changed from MODIFIED to 5

#18 Updated by semyers over 4 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE

#19 Updated by bmbouter over 1 year ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF