Bug 1646603 - [Container Admin] Registry Name Pattern with repository.url will always be rejected
Summary: [Container Admin] Registry Name Pattern with repository.url will always be re...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Container Management - Content
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: Released
Assignee: Andrew Kofink
QA Contact: Mirek Zalewski
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-05 18:19 UTC by Mirek Zalewski
Modified: 2019-10-07 17:13 UTC (History)
2 users (show)

Fixed In Version: tfm-rubygem-katello-3.10.0.10-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-14 12:38:40 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:1222 None None None 2019-05-14 12:38:47 UTC
Foreman Issue Tracker 25781 None None None 2019-01-04 15:16:24 UTC

Description Mirek Zalewski 2018-11-05 18:19:01 UTC
Registry Name Pattern claims to allow repository.url variable, but it always reject it. If that variable is used, error message will be displayed: "An error occurred saving the Environment: Registry name pattern will result in invalid container image name of member repositories".


The problem is that name created by pattern must pass through ContainerImageNameValidator.validate_name function. It checks name against following regexp:
/\A([a-z0-9]+[a-z0-9\-\_\.]*)+(\/[a-z0-9]+[a-z0-9\-\_\.]*)*\z/

This regexp allows multiple slashes in name, but not subsequently (/ is OK, // is not). URL will contain :// (colon slash slash) sequence between protocol and host name. So URL technically can be used, but it will be rejected as invalid.



Version:
Satellite 6.5 snap 2
katello-3.9.0-0.11.rc2.el7sat.noarch
satellite-6.5.0-3.beta.el7sat.noarch
foreman-1.20.0-0.17.RC2.el7sat.noarch


Steps to reproduce:
1. Content -> Lifecycle Environment
2. Select environment other than "Library" (create one if necessary)
3. In registry pattern name field, put pattern with repository.url variable (example: "<%= organization.label %>/<%= repository.url %>/<%= repository.docker_upstream_name %>")
4. Save

Comment 4 Andrew Kofink 2019-01-04 15:16:23 UTC
Created redmine issue https://projects.theforeman.org/issues/25781 from this bug

Comment 5 Bryan Kearney 2019-01-07 21:15:08 UTC
Upstream bug assigned to akofink@redhat.com

Comment 6 Bryan Kearney 2019-01-08 21:17:01 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25781 has been resolved.

Comment 8 Mirek Zalewski 2019-01-28 10:56:29 UTC
Fix confirmed after re-test.
There is no mention of "repository.url" in contextual help on Lifecycle Environment page.
Using registry name pattern from initial report above, on saving I get error message: "An error occurred saving the Environment: Registry name pattern will result in invalid container image name of member repositories"


Tested on:
Satellite 6.5 snap 13
foreman-1.20.1.9-1.el7sat.noarch
satellite-6.5.0-6.beta.el7sat.noarch
katello-3.10.0-0.6.rc1.el7sat.noarch
tfm-rubygem-katello-3.10.0.15-1.el7sat.noarch
pulp-server-2.18.0-0.1.rc.el7sat.noarch

Comment 11 errata-xmlrpc 2019-05-14 12:38:40 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/RHSA-2019:1222


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