In attempting to script against the Juju CLI I ran into an issue trying to loop through my controllers, loop through the models, and then juju status each model. The YAML output has a name of the model, but in a model that's been shared with me via JAAS the name isn't enough to complete a juju status. It needs to be prefixed by the user@external/modelname.
However, it's not obvious this needs to happen. If you look at the Juju output it "does the right thing" in that it outputs the prefixed model name using internal logic when it needs to. However, then I have to duplicate that logic in my script. Ideally there'd be some sort of id or field in the YAML I could rely on that uses the same logic Juju already uses to build that useful name up.
To rephrase this as I understand it:
"juju list-models -format yaml" produces entries
with "name" and "owner", but when selecting a model
with -m, the argument needs to contain both name
and owner.
If you know how model names work, you can just use
$name/$owner but it might be useful to have a field that
contained the full name too.