From 4ed22358f4cbbe1b920cd28a249f698c5150cefb Mon Sep 17 00:00:00 2001 From: Daniela Plascencia Date: Wed, 29 May 2024 11:16:11 +0200 Subject: [PATCH] fix: check routes is not empty before popping values This commit ensures the istio-pilot charm checks that the ingress routes dictionary it uses for reconciling VirtualServices from requirers is not empty before attempting to pop values during a RelationBroken event. Fixes #423 --- charms/istio-pilot/src/charm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charms/istio-pilot/src/charm.py b/charms/istio-pilot/src/charm.py index 13a0c0da..428c9138 100755 --- a/charms/istio-pilot/src/charm.py +++ b/charms/istio-pilot/src/charm.py @@ -606,7 +606,7 @@ def _get_ingress_data(self, event) -> dict: f" departing application's name. We assume that the departing application's" f" is not in routes.keys='{list(routes.keys())}'." ) - else: + elif: routes.pop((event.relation, event.app)) return routes