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

DPE-5493 Skip tls reconfiguration on unit teardown #522

Merged
merged 2 commits into from
Sep 22, 2024
Merged
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
5 changes: 4 additions & 1 deletion lib/charms/mysql/v0/tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

LIBID = "eb73947deedd4380a3a90d527e0878eb"
LIBAPI = 0
LIBPATCH = 7
LIBPATCH = 8

SCOPE = "unit"

Expand Down Expand Up @@ -166,6 +166,9 @@ def _on_certificate_expiring(self, event: CertificateExpiringEvent) -> None:

def _on_tls_relation_broken(self, _) -> None:
"""Disable TLS when TLS relation broken."""
if self.charm.removing_unit:
logger.debug("Unit is being removed, skipping TLS cleanup.")
return
try:
if not ops.jujuversion.JujuVersion.from_environ().has_secrets:
self.charm.set_secret(SCOPE, "certificate-authority", None)
Expand Down
Loading