Project

General

Profile

Actions

Feature #25781

closed

[Container Admin Feature] Registry Name Pattern with repository.url will always be rejected

Added by Andrew Kofink about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1646603

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:
katello-3.9.0-0.11.rc2.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

Actions

Also available in: Atom PDF