-
Notifications
You must be signed in to change notification settings - Fork 10
Description
When working on #1432 to import offers into JIMM, I didn't address the scenario where is collision with an existing offer URL.
For context, an offer URL takes the form:
- [offer-owner]/[model-name].[app-name/alias]
- E.g.
admin/foo.postgresql
At first glance it struck me that we can't have a collision when importing offers into JIMM because the Juju controller enforces this URL must be unique. This was until I realised JIMM could import models with the same name from multiple controllers.
Consider Controller A with model foo
and Controller B with model foo
, both created by an admin user. When importing these models into JIMM, you would import these to a new owner say "kian@canonical.com" the second model import will fail because kian@canonical.com/foo
already exists.
Overall, the case where offer URLs collide seems to be a subset of the problem where model names collide.
In #1272 I changed the way model uniqueness was enforced in JIMM. Previously a model was unique according to a combination of (controller, name, owner). Now it is unique according to (name, owner), meaning that we more closely match Juju's behaviour that a user cannot have two models with the same name (previously we had conflicts in the Juju CLI if you had access to two models with the same owner and same model name).
How can we address the situation where you want to import a model where the name is already used because of another controller?
Some ideas:
- Allow the model name to be changed.
- Tell the user to add the model to a different owner.