Skip to content

Commit

Permalink
chore: Update charm libraries (#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
telcobot authored Oct 18, 2024
1 parent e1e526e commit 596a522
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/charms/tls_certificates_interface/v4/tls_certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 0
LIBPATCH = 1

PYDEPS = ["cryptography", "pydantic"]

Expand Down Expand Up @@ -1299,8 +1299,16 @@ def _find_available_certificates(self):
logger.debug("Certificate requested for different attributes - Skipping")
continue
try:
logger.debug("Setting secret with label %s", secret_label)
secret = self.model.get_secret(label=secret_label)
logger.debug("Setting secret with label %s", secret_label)
# Juju < 3.6 will create a new revision even if the content is the same
if secret.get_content(refresh=True).get("certificate", "") == str(
provider_certificate.certificate
):
logger.debug(
"Secret %s with correct certificate already exists", secret_label
)
return
secret.set_content(
content={
"certificate": str(provider_certificate.certificate),
Expand Down

0 comments on commit 596a522

Please sign in to comment.