[ops-sunbeam] ingress_changed can fail when the relation is gone
Catch AttributeError/KeyError as a stop gap to prevent _ingress_changed to fail on relation-broken. Change-Id: Ib29af68bf498c6adb84064f871dc678b783213c3 Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
This commit is contained in:
parent
8ca8d63e3a
commit
5210d9e230
@ -851,9 +851,12 @@ class OSBaseOperatorAPICharm(OSBaseOperatorCharmK8S):
|
|||||||
logger.debug("Received an ingress_changed event")
|
logger.debug("Received an ingress_changed event")
|
||||||
if hasattr(self, "id_svc"):
|
if hasattr(self, "id_svc"):
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Updating service endpoints after ingress " "relation changed."
|
"Updating service endpoints after ingress relation changed."
|
||||||
)
|
)
|
||||||
|
try:
|
||||||
self.id_svc.update_service_endpoints(self.service_endpoints)
|
self.id_svc.update_service_endpoints(self.service_endpoints)
|
||||||
|
except (AttributeError, KeyError):
|
||||||
|
pass
|
||||||
|
|
||||||
self.configure_charm(event)
|
self.configure_charm(event)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user