Jhack CMR updates

Hi all! Jhack just received a tiny update to some of its CMR-related functionality.

jhack show-relation now supports CMRs

The one caveat is that the command needs to be executed from the POV of the model that has the relation. CMRs behave a bit differently than regular relations. In particular, if you cross-model-relate app A in model M to app B in model N, whether the relation will show up in model M or in model N in its relation list (instead of it being only visible as an Offer) depends on where the provider lives. If A is the provider, the relation will be listed in juju status --relations --model M. If B is the provider, the relation will appear in juju status --relations --model N. In other words, in some sense, the relation ‘belongs’ to the model where the provider lives.

Consequently, if you are switched to model M, you can jhack show-relation A:x B:y if and only if A is the provider in the relation; if A is the requirer, then you need to jhack show-relation A:x B:y --model N.

An example of what a CMR looks like in jhack:

Note how the relation has different IDs in the two models, and the model field differs.

Compare this with a regular relation:

And a peer relation:

jhack pull-cmr how has an ALL option

Remember how you can use jhack pull-cmr to create CMRs for you? Well, you used to have to select a single CMR to create, but now there is an ALL option. Its semantics should be self-explanatory.

To try these goodies out, snap install jhack --channel=edge!

2 Likes