Project

General

Profile

Feature #25781

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

Added by Andrew Kofink 6 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Team Backlog:
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

Associated revisions

Revision 3cc98400 (diff)
Added by Andrew Kofink 5 months ago

Fixes #25781: Disallow repo.url in LE registry_name_pattern

History

#1 Updated by Andrew Kofink 6 months ago

  • Target version set to Katello 3.11.0
  • Assignee set to Andrew Kofink
  • 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

#2 Updated by The Foreman Bot 5 months ago

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

#3 Updated by Andrew Kofink 5 months ago

  • Status changed from Ready For Testing to Closed

#4 Updated by Jonathon Turel 5 months ago

  • Triaged changed from No to Yes

Also available in: Atom PDF