Feature #25781
closed[Container Admin Feature] Registry Name Pattern with repository.url will always be rejected
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
Updated by Andrew Kofink almost 6 years ago
- Subject changed from [Container Admin Feature] Registry Name Pattern with repository.url will always be rejected to [Container Admin Feature] Registry Name Pattern with repository.url will always be rejected
- Assignee set to Andrew Kofink
- Target version set to Katello 3.11.0
Updated by The Foreman Bot almost 6 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/Katello/katello/pull/7912 added
Updated by Andrew Kofink almost 6 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|3cc984002fc1e56c44f2d67a75a098d7c5f83880.