Bug #18533

Docker upstream repository name length limit

Added by Filip Van Raemdonck about 1 year ago. Updated 8 months ago.

Assigned To:Thomas McKay
Target version:Team Tom - iteration 11
Difficulty:trivial Pull request:https://github.com/Katello/katello/pull/6660
Bugzilla link:1484405
Story points-
Velocity based estimate-
ReleaseKatello 3.4.0Release relationshipAuto


Trying to add a docker repository with a length of more than 30 characters for the image name part fails with error: "Docker upstream name must be a valid docker name"

This seems somewhat arbitrary, image with a name of more than 30 characters do exist on Docker Hub (and other publicly accessible registries).

$ sudo docker search openvswitch | grep -E "/[a-zA-Z0-9-]{30}[^ ]" 
docker.io    docker.io/intelonp/centos-source-neutron-openvswitch-agent                            centos-source-neutron-openvswitch-agent         0                    [OK]
docker.io    docker.io/intelonp/centos-source-openvswitch-db-server                                centos-source-openvswitch-db-server             0                    [OK]
docker.io    docker.io/intelonp/centos-source-openvswitch-vswitchd                                 centos-source-openvswitch-vswitchd              0                    [OK]
docker.io    docker.io/rbbratta/centos-source-neutron-openvswitch-agent                            centos-source-neutron-openvswitch-agent         0                    [OK]
docker.io    docker.io/rbbratta/centos-source-openvswitch-db-server                                centos-source-openvswitch-db-server             0                    [OK]
docker.io    docker.io/rbbratta/centos-source-openvswitch-vswitchd                                 centos-source-openvswitch-vswitchd              0                    [OK]
docker.io    docker.io/tripleoupstream/centos-binary-openvswitch-vswitchd                                                                          0

Associated revisions

Revision 67fa4623
Added by Thomas McKay about 1 year ago

fixes #18533 - container name validation


#1 Updated by Thomas McKay about 1 year ago

  • Assigned To set to Thomas McKay
  • Target version set to Team Tom - iteration 11

#2 Updated by Filip Van Raemdonck about 1 year ago

From https://github.com/docker/distribution/blob/master/docs/spec/api.md

Classically, repository names have always been two path components where each path component is less than 30 characters. The V2 registry API does not enforce this. The rules for a repository name are as follows:

A repository name is broken up into path components. A component of a repository name must be at least one lowercase, alpha-numeric characters, optionally separated by periods, dashes or underscores. More strictly, it must match the regular expression [a-z0-9]+(?:[._-][a-z0-9]+)*.
If a repository name has two or more path components, they must be separated by a forward slash ("/").
The total length of a repository name, including slashes, must be less than 256 characters.

So it looks like the existing restriction in katello is a relic from v1 registry era.

#3 Updated by Justin Sherrill about 1 year ago

  • Release set to Katello 3.4.0
  • Difficulty set to trivial

#4 Updated by The Foreman Bot about 1 year ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/6660 added

#5 Updated by Thomas McKay about 1 year ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#6 Updated by Thomas McKay 8 months ago

  • Bugzilla link set to 1484405

Also available in: Atom PDF