Skip to content

Commit

Permalink
fix: check routes is not empty before popping values (#424)
Browse files Browse the repository at this point in the history
This commit ensures the istio-pilot charm checks that the ingress routes dictionary it uses for reconciling VirtualServices from requirers is not empty and the relation data for the departing application is there before attempting to pop values during a RelationBroken event.

Fixes #423
  • Loading branch information
DnPlas committed May 29, 2024
1 parent 48025b8 commit a7cc3b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions charms/istio-pilot/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,8 @@ 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:
routes.pop((event.relation, event.app))
elif routes:
routes.pop((event.relation, event.app), None)

return routes

Expand Down

0 comments on commit a7cc3b4

Please sign in to comment.