Skip to content

Commit

Permalink
fix: check routes is not empty before popping values
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 before attempting
to pop values during a RelationBroken event.

Fixes #423
  • Loading branch information
DnPlas committed May 29, 2024
1 parent 10e2bda commit 7e2fbe0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion charms/istio-pilot/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
routes.pop((event.relation, event.app))

return routes
Expand Down

0 comments on commit 7e2fbe0

Please sign in to comment.