juju offer doesn't support -m to act on non-current model
Bug #1832160 reported by
Vern Hart
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Low
|
Unassigned |
Bug Description
Most juju commands allow you to specify `-m model` to operate in a different model than the current model. Additionally, you can specify JUJU_MODEL as an environment variable to override the current model context.
The only commands that operate in the context of a model but don't allow you to use -m or JUJU_MODEL to set the model have to do with cross model relations:
juju offer
juju show-offer
juju find-offers
juju remove-offer
Interestingly, the following cmr related commands DO honor the -m argument:
juju list-offers
juju offers
It would be nice if I could create an offer (juju offer) without affecting the current model.
Changed in juju: | |
status: | New → Triaged |
importance: | Undecided → Medium |
tags: | added: cross-model usability |
To post a comment you must log in.
juju offer doesn't use -m because the model to use is part of the offer URL. This allows the offer command to work correctly across different controllers. The offer command is a so called "controller" command and not a "model" command. Many juju commands like "add-model" etc also operate as controller commands, where -m is not required.
eg mymodel. myapp:db
juju offer mymodel.myapp:db
juju offer myctrl:
Without the controller/model part of the URL, juju offer does default to the current model as would be expected.
The same logic then also applies to show/find/remove offer.
ie you show an offer based on its URL. The URL may leave out the controller and model parts, in which case it defaults to the current controller / model.
Hopefully this clarifies the usage.