From d7524283c2b9bb2e396929631769df0ac2744bae Mon Sep 17 00:00:00 2001 From: welpaolo Date: Thu, 13 Apr 2023 11:53:32 +0200 Subject: [PATCH] Reintroduce check for container ready (#50) --- src/tls.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tls.py b/src/tls.py index 8286fb4c..b1e431f9 100644 --- a/src/tls.py +++ b/src/tls.py @@ -91,6 +91,10 @@ def _on_certificate_available(self, event) -> None: event.defer() return + if not self.charm.container.can_connect(): + event.defer() + return + # avoid setting tls files and restarting if event.certificate_signing_request != self.csr: logger.error("Can't use certificate, found unknown CSR")