esunar / test4

GNU General Public License v3.0
0 stars 0 forks source link

juju-lint throws a false positive about the missing LMA if the LMA is deployed in the separate model #15

Closed esunar closed 2 years ago

esunar commented 2 years ago

$ juju-lint -c /snap/juju-lint/current/contrib/canonical-rules.yaml /tmp/juju-status.json 2020-09-25 07:30:08 [INFO] juju-lint version 1.0.1 starting...

2020-09-25 07:30:08 [INFO] [/tmp/juju-status.json] Linting manual file... 2020-09-25 07:30:09 [ERROR] [/tmp/juju-status.json] Charm 'advanced-routing' in model manual on controller manual not recognised 2020-09-25 07:30:09 [ERROR] [/tmp/juju-status.json] Ops charm 'elasticsearch' in model manual on controller manual not found 2020-09-25 07:30:09 [ERROR] [/tmp/juju-status.json] Ops charm 'grafana' in model manual on controller manual not found 2020-09-25 07:30:09 [ERROR] [/tmp/juju-status.json] Ops charm 'graylog' in model manual on controller manual not found 2020-09-25 07:30:09 [ERROR] [/tmp/juju-status.json] Ops charm 'landscape-server' in model manual on controller manual not found 2020-09-25 07:30:09 [ERROR] [/tmp/juju-status.json] Ops charm 'nagios' in model manual on controller manual not found 2020-09-25 07:30:09 [ERROR] [/tmp/juju-status.json] Ops charm 'prometheus2' in model manual on controller manual not found

But in reality these charms/applications are deployed in the "lma" model at the same controller and related to the cloud units over the CMR.


Imported from Launchpad using lp2gh.

esunar commented 2 years ago

(by afreiberger) We're going to have this same issue on all newer builds.

I think the linter should be able to take all bundles and statuses from a single controller and link the SAAS bits together and audit all models as a whole. This would include the ability to lint 2 or more k8s models sharing one LMA stack.

esunar commented 2 years ago

(by phausman) I'm using juju-lint version 1.0.2.dev52+gea337d4 on a deployment with separate LMA mode and I'm still seeing this:

2021-10-12 17:36:13 [ERROR] [tests/juju-lint/juju-status.json] [manual/manual] Ops charm 'landscape-server' is missing

landscape-server is deployed in 'lma' model.

esunar commented 2 years ago

(by jfguedez) As discusse elsewhere, juju-lint doesn't support multiple models yet [0]. It attempts to match requirements via cross-model relations (CMR), which works for graylog, grafana, nagios, prometheus, etc. However, as the landscape connections are not tracked via juju (no relation), this doesn't work for landscape.

A workaround is to add an "offer" for landscape, so it shows up under "SAAS" in juju status even though there is no relation. As the offer can only be done if you have an existing instance, it can be used to check the presence of landscape (and will resolve the error in juju-lint)

[0] https://bugs.launchpad.net/juju-lint/+bug/1934405