Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refs #38269 - fix container-image-name validator #11336

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

m-bucher
Copy link
Contributor

@m-bucher m-bucher commented Mar 5, 2025

This does not fix the underlying issue, yet!

The issue being that Organization Labels ending with non-alphanumeric characters will break the container-image-name used for publishing in pulp.
I am hesitant to just strip them, because it may happen that there are two Organizations ACME Inc. and ACME Inc. Stripping the _ from the Labels will end in both Orgs having the same container-image base-path.

What are the changes introduced in this pull request?

Fixes the Container-Image-Name Validator to detect the same as pulp-container (see https://github.com/pulp/pulp_container/blob/bd2a27e9f581d675bf33232fede2a6466d56aa3d/pulp_container/app/serializers.py#L39).
With this fix it is no longer possible to create docker-type repos in Organizations whose Label ends in _. Creation worked before but synchronizing failed, because pulp rejects the container-image-name.

I am open for suggestions on how to fix this thoroughly 🤔

@ianballou
Copy link
Member

ianballou commented Mar 5, 2025

Stripping the _ from the Labels will end in both Orgs having the same container-image base-path.

In this case, I think we can resort to the "by ID" method that we have for ambiguous organization labels. We had to implement it since containers can't have uppercase letters. "Default_Org" and "default_org" would clash, for example.

This method is documented at the bottom of the section here https://docs.theforeman.org/nightly/Managing_Content/index-katello.html#Using_Container_Registries_content-management

Edit: my comment was related to container push only. However, for normal repositories, we could also rely on the clashing name error to pop up. In that case, users would need to edit their Library lifecycle environment container naming scheme for the org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants