canonical / nginx-ingress-integrator-operator

nginx-ingress-integrator-operator - charm repository.
Apache License 2.0
1 stars 8 forks source link

Handle the ingress-relation-broken event #139

Open mthaddon opened 5 months ago

mthaddon commented 5 months ago

Applicable spec: N/A

Overview

Correctly handle the ingress-relation-broken event (for instance in case of destroying a model).

Rationale

Currently if you have an ingress relation and try to destroy the model we're trying to run get_all_hostnames but it's failing with an InvalidIngressError.

Juju Events Changes

N/A

Module Changes

N/A

Library Changes

N/A

Checklist

github-actions[bot] commented 2 months ago

Test coverage for 54f63f5f0d1366f0651a070833daecbf4f7c9fb7

Name                               Stmts   Miss Branch BrPart  Cover   Missing
------------------------------------------------------------------------------
src/charm.py                         273     14     80      5    95%   198, 205, 283-285, 322, 360, 411, 549-559, 564-565
src/consts.py                          4      0      0      0   100%
src/controller/__init__.py             0      0      0      0   100%
src/controller/endpoint_slice.py      55      4     10      4    88%   103, 127, 149, 169
src/controller/endpoints.py           33      1      6      0    92%   53
src/controller/ingress.py            103      8     44      4    89%   60, 80-81, 185, 262->273, 266-268, 271-272
src/controller/resource.py            53      1      9      1    97%   64
src/controller/secret.py              58      8     19      4    79%   53, 71-76, 106->111, 108-110, 111->104, 133, 162
src/controller/service.py             37      1      6      0    93%   51
src/exceptions.py                      3      0      0      0   100%
src/ingress_definition.py            271     26     70      8    89%   41, 70, 174-178, 196, 315-316, 361, 373, 377, 393-394, 409-410, 435, 437, 462-463, 496-497, 504-506, 508
src/tls_relation.py                  130      6     31      1    94%   137, 150-156
------------------------------------------------------------------------------
TOTAL                               1020     69    275     27    91%
Coverage failure: total of 91 is less than fail-under=92

Static code analysis report

Run started:2024-08-06 14:32:31.405372

Test results:
    No issues identified.

Code scanned:
    Total lines of code: 4910
    Total lines skipped (#nosec): 11
    Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
    Total issues (by severity):
        Undefined: 0
        Low: 0
        Medium: 0
        High: 0
    Total issues (by confidence):
        Undefined: 0
        Low: 0
        Medium: 0
        High: 0
Files skipped (0):