canonical / jhack

Chock-full of Juju hackery.
Apache License 2.0
50 stars 24 forks source link

`show-relation` fails on cross model relations with alias #178

Open Mehdi-Bendriss opened 2 months ago

Mehdi-Bendriss commented 2 months ago

On a cross model relation with an offer made with an alias, the show-relation sub-command is unable to resolve the app from both the "offerer" and the "consumer" models.

Model dev:

juju deploy opensearch main  
juju offer main:peer-cluster-orchestrator main-orchestrator

Model dev1:

juju deploy opensearch data
juju integrate data:peer-cluster admin/dev.main-orchestrator

Then from the model dev1:

jhack show-relation main-orchestrator:peer-cluster-orchestrator data:peer-cluster

===> KeyError: 'main-orchestrator'

or by specifying the model name:

jhack show-relation -m dev main-orchestrator:peer-cluster-orchestrator data:peer-cluster

===> RuntimeError: No relation found with endpoints 'main-orchestrator:peer-cluster-orchestrator' -> 'data:peer-cluster' in model 'dev'. 'data' not found in model 'dev'

jhack version: 0.4.3.1


Simplified juju status:

Model  Controller  Cloud/Region         Version  SLA          Timestamp
dev1   lxd         localhost/localhost  3.4.5    unsupported  16:14:28Z

SAAS               Status   Store  URL
main               unknown  lxd    admin/dev.main
main-orchestrator  active   lxd    admin/dev.main-orchestrator

App   Version  Status   Scale  Charm       Channel  Rev  Exposed  Message
data           active.      3  opensearch             0  no       

Unit     Workload  Agent  Machine  Public address  Ports  Message
data/0*  active    idle   0        10.122.32.14           
data/1   active    idle   1        10.122.32.134
data/2   active    idle   2        10.122.32.195

Machine  State    Address        Inst id        Base          AZ  Message
0        started  10.122.32.14   juju-075bd2-0  ubuntu@22.04      Running
1        started  10.122.32.134  juju-075bd2-1  ubuntu@22.04      Running
2        started  10.122.32.195  juju-075bd2-2  ubuntu@22.04      Running

Integration provider                         Requirer                 Interface           Type     Message
main-orchestrator:peer-cluster-orchestrator  data:peer-cluster        peer_cluster        regular
PietroPasotti commented 2 months ago

I'm struggling to find the aliased app's data anywhere in juju show-unit. I suspect there's a bug in show-unit itself, which won't list any aliased SAAS. If that's the case, there's currently no way in juju to inspect aliased CMR data.

PietroPasotti commented 2 months ago

I will work around that with a super-nasty hack if this is confirmed