Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle the ingress-relation-broken event #139

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,19 @@ def _on_all_certificates_invalidated(self, _: AllCertificatesInvalidatedEvent) -
if tls_relation:
tls_relation.data[self.app].clear()
if JujuVersion.from_environ().has_secrets:
hostnames = self.get_all_hostnames()
try:
hostnames = self.get_all_hostnames()
except InvalidIngressError as e:
LOGGER.warning("InvalidIngressError: %s", e)
LOGGER.warning(
(
"Certificates relation removed so our ingress definition may be "
"invalid. Just ignore, since we're likely removing the charm or "
"the entire model, in which case Juju will clean up the relevant "
"k8s resources."
)
)
return
for hostname in hostnames:
try:
secret = self.model.get_secret(label=f"private-key-{hostname}")
Expand Down
Loading