[katello-devel] Foreman envs mapping and Katello label format

Dmitri Dolguikh dmitri at redhat.com
Wed Apr 17 12:38:04 UTC 2013


On 2013-04-16 1:57 PM, Ivan Necas wrote:
> Hi there,
>
> TL;DR:
>
> Suggestion to prevent '-' and '__' (double dash) to be valid substrings
> in Katello label.
>
> Body:
>
> I'm working on orchestration of Katello environments and content
> views into Foreman environments and run into an interesting issue.
>
> In Katello, we allow "-" to be part of a label name. In Foreman however,
> the environment in Foreman is not allowed to have "-" inside name (puppet restriction). Except
> this, the conditions are the same. Therefore I suggest removing "-" from Katello label allowed characters.

Sounds good to me (but please read on).

>
> Otherwise, we run into complications with suggesting the right name for
> Foreman environment, let's say, we have both "env-one" and "env_one" in
> one Katello environment. How to generate valid Foreman name for both of
> them (other than adding suffix with Katello numberic id to it).

Assuming we substitute a "-" to an "_" when creating an environment in 
Foreman, and "env_one" already exists there, environment creation will 
fail, as Foreman requires unique environment names. Provided the error 
message is clear enough about the cause of the problem, I think not 
restricting the user input on Katello side would work too.

>
> Also, I would like to encode the mapping into the Foreman name, so that
> we don't have to add new attributes to Foreman environment model. My
> suggestion is to use this format:
>
> Org_label__Env_label                        # for env mapping
> Org_label__Env_label__Content_view_label    # for content view mapping

I think extending the model via the engine and using envrionment uuid is 
a better (less fragile) approach. This would also resolve the issue with 
restricting the use of "_" in environment names.

>
> This would require us to disallow "__" as part of the Katello label as well,
> which is my second suggestion.
>
> Note: the env name in this form might be quite long in Foreman forms. Therefore,
> the foreman-katello-engine would group this environments together, so that the
> envrionements select would look like this:
>
> Environment: _____________________
>               |Acme_Corporation
>               |  Dev
>               |    CV1
>               |    CV2
>               |  Test
>               |    CV1
>               ---------------------
>
>
> This change would make migration from older Katello version a bit more complicated. It would
> also require to change the format of uuid suggested labels (that use "-" as separator),
Again, if we stick to uuids, the migration would be simpler (and no 
complications with earlier versions of Katello). I think we can strip 
"-" from uuids altogether (and add them back as needed), as the uuid 
format is mandated by the rfc.

-d

> but
> I personally think, that it would save us a lot of troubles when integration Foreman.
>
> -- Ivan
>
> _______________________________________________
> katello-devel mailing list
> katello-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/katello-devel




More information about the katello-devel mailing list