Bug 1393801 - Default 'Name of the container in the registry' doesn't allow '/' and 'dot'
Summary: Default 'Name of the container in the registry' doesn't allow '/' and 'dot'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: Tools
Version: 3.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.0.0
Assignee: bizhang
QA Contact: Irina Gulina
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-10 11:12 UTC by Irina Gulina
Modified: 2017-03-01 22:13 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-01 22:13:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0367 0 normal SHIPPED_LIVE Red Hat Update Infrastructure 3.0 Release 2017-03-02 03:05:22 UTC

Description Irina Gulina 2016-11-10 11:12:28 UTC
Description of problem:
Default 'Name of the container in the registry' is always equal to 'ID for the container'. 'ID for the container' can be alphanumerics, _, and - only. But on https://registry.access.redhat.com Container Image can have '.' in its name and most Containers have '/'. Therefore, default 'Name of the container in the registry' is never* good one and pressing 'Enter' prompts a user for a different one.

*Actually I didn't see Container named with alphanumerics, _, and - only, but maybe there are some.

Version-Release number of selected component (if applicable):
ISO 20161109

How reproducible:
always

Steps to Reproduce:
1. add a RH docker repo

Actual results:
1) Use only alphanumerics, _, and - for container ID

rhui (repo) => ad

Unique ID for the container (alphanumerics, _, and - only):
jboss-eap-7

Name of the container in the registry: [jboss-eap-7]:


Could not find jboss-eap-7 on registry https://registry.access.redhat.com, please make sure that the name is valid

Name of the container in the registry: [jboss-eap-7]:

2) Try to enter ID as it's on  https://registry.access.redhat.com
Unique ID for the container (alphanumerics, _, and - only):
jboss-eap-7/eap70-openshift

Only alphanumerics, underscore (_), and hyphen (-) are valid in a repository ID.

Unique ID for the container (alphanumerics, _, and - only):


Expected results:
Default 'Name of the container in the registry' allows [ENTER] or there is no any Default

Additional info:
There are 2 ways to fix it:
1) Allow '.' and '/' in ID of RH docker repos and other possible symbols, so repo ID will match actual Containers' names on https://registry.access.redhat.com
2) Remove default value for 'Name of the container in the registry', prompt an user to enter Container name.

Comment 3 Radek Bíba 2016-11-14 12:30:20 UTC
Wait, there *are* containers whose names in the registry only contain the characters that are only valid in the unique ID. Not many, but still...

See here: https://access.redhat.com/search/#/container-images?q=&p=6&sort=relevant&rows=12&srch=any&documentKind=ImageRepository (scroll down to the first one, named simply "rhel").

And this is how one of these containers can be added conveniently:

====
rhui (repo) => ad

Unique ID for the container (alphanumerics, _, and - only):
rhel7

Name of the container in the registry: [rhel7]:


Display name for the container: [rhel7]:
Red Hat Enterprise Linux 7

The following container will be added:
  Container Id:              rhel7
  Display Name:              Red Hat Enterprise Linux 7
  Upstream Container Name:   rhel7
Proceed? (y/n) y

Successfully added container Red Hat Enterprise Linux 7
====

Let's not remove this feature. Patrick?

Comment 4 Patrick Creech 2016-11-14 16:16:17 UTC
We do need to update the validation scheme for a docker 'repository'.  It should match the same validation scheme pulp itself utilizes for this situation.

We will update the validation with what is done in the pulp-docker plugin

Comment 5 bizhang 2016-11-14 19:12:09 UTC
There is an issue with characters such as '/' in a pulp repo id. I made changes to prompt the user for the registry name first, and have the default id be registry name with '/' replaced with '_'

Comment 6 Radek Bíba 2016-11-15 08:09:06 UTC
I'm not talking about the validation scheme. It's the summary of this bug report, "Default 'Name of the container in the registry' is always wrong" plus the statement that the default name is never good (and therefore it's meaningless to offer it in the first place) that turn out to be incorrect. Since there are containers with simple "alphanumeric-and-dot-only" names, it makes sense for the wizard to offer the entered unique ID as a potential/default name of a container at registry.redhat.com so that the user doesn't have to re-type the name of such a container.

Comment 7 Irina Gulina 2016-11-15 11:10:39 UTC
(In reply to bizhang from comment #5)
> There is an issue with characters such as '/' in a pulp repo id. I made
> changes to prompt the user for the registry name first, and have the default
> id be registry name with '/' replaced with '_'

I like your solution! Thanks!

Comment 8 Irina Gulina 2016-11-16 08:50:11 UTC
Hm.. what about 'dot'? 

Name of the container in the registry: 
rhel7.3

Unique ID for the container (alphanumerics, _, and - only): [rhel7.3]
[ENTER]

Only alphanumerics, underscore (_), and hyphen (-) are valid in a repository ID.

Unique ID for the container (alphanumerics, _, and - only): [rhel7.3]

Can it maybe be replaced with '_' too? 

Replacement of '/' with '_' works fine: 

rhui (repo) => ad

Name of the container in the registry: 
rhcertification/redhat-certification

Unique ID for the container (alphanumerics, _, and - only): [rhcertification_redhat-certification]
[ENTER]

Display name for the container: [rhcertification_redhat-certification]:
RH Certification Docker           

The following container will be added:
  Container Id:              rhcertification_redhat-certification
  Display Name:              RH Certification Docker
  Upstream Container Name:   rhcertification/redhat-certification
Proceed? (y/n) y

Successfully added container RH Certification Docker

Comment 9 bizhang 2016-11-22 15:11:24 UTC
Good point. I'll make the change to also replace '.' in the 11/22 build

Comment 10 Irina Gulina 2016-11-23 09:52:23 UTC
ISO 20161122

>> rhui (repo) => ad

Name of the container in the registry: 
rhel7.0

Unique ID for the container (alphanumerics, _, and - only) [rhel7_0]:


Display name for the container [rhel7_0]:
rhel7.o Docker

The following container will be added:
  Container Id:              rhel7_0
  Display Name:              rhel7.o Docker
  Upstream Container Name:   rhel7.0
Proceed? (y/n) y

Successfully added container rhel7.o Docker

Comment 11 errata-xmlrpc 2017-03-01 22:13:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:0367


Note You need to log in before you can comment on or make changes to this bug.