Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions lib/charms/postgresql_k8s/v0/postgresql_tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

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

logger = logging.getLogger(__name__)
SCOPE = "unit"
Expand Down Expand Up @@ -125,8 +125,8 @@ def _on_tls_relation_broken(self, _) -> None:

def _on_certificate_available(self, event: CertificateAvailableEvent) -> None:
"""Enable TLS when TLS certificate available."""
if event.certificate_signing_request != self.charm.get_secret(SCOPE, "csr"):
logger.error("An unknown certificate expiring.")
if event.certificate_signing_request.strip() != self.charm.get_secret(SCOPE, "csr").strip():
logger.error("An unknown certificate available.")
return

self.charm.set_secret(
Expand All @@ -144,7 +144,7 @@ def _on_certificate_available(self, event: CertificateAvailableEvent) -> None:

def _on_certificate_expiring(self, event: CertificateExpiringEvent) -> None:
"""Request the new certificate when old certificate is expiring."""
if event.certificate != self.charm.get_secret(SCOPE, "cert"):
if event.certificate.strip() != self.charm.get_secret(SCOPE, "cert").strip():
logger.error("An unknown certificate expiring.")
return

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cryptography==37.0.4
ops==1.5.0
ops==1.5.4
pgconnstr==1.0.1
requests==2.28.1
tenacity==8.0.1
18 changes: 9 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ commands =
description = Check code against coding style standards
deps =
black
flake8==4.0.1 # flake8 version 5.0.0 & 5.0.1 has issues with flake8.options.config
flake8==5.0.4 # https://github.com/savoirfairelinux/flake8-copyright/issues/19
flake8-docstrings
flake8-copyright
flake8-builtins
Expand Down Expand Up @@ -71,7 +71,7 @@ commands =
description = Run charm integration tests
deps =
pytest
juju==2.9.11 # juju 3.0.0 has issues with retrieving action results
juju~=2.9.0 # Latest juju 2
landscape-api-py3
mailmanclient
pytest-operator
Expand All @@ -90,7 +90,7 @@ allowlist_externals =
description = Run database relation integration tests
deps =
pytest
juju==2.9.11 # juju 3.0.0 has issues with retrieving action results
juju~=2.9.0 # Latest juju 2
landscape-api-py3
mailmanclient
pytest-operator
Expand All @@ -109,7 +109,7 @@ allowlist_externals =
description = Run db relation integration tests
deps =
pytest
juju==2.9.11 # juju 3.0.0 has issues with retrieving action results
juju~=2.9.0 # Latest juju 2
landscape-api-py3
mailmanclient
pytest-operator
Expand All @@ -128,7 +128,7 @@ allowlist_externals =
description = Run db-admin relation integration tests
deps =
pytest
juju==2.9.11 # juju 3.0.0 has issues with retrieving action results
juju~=2.9.0 # Latest juju 2
landscape-api-py3
mailmanclient
pytest-operator
Expand All @@ -147,7 +147,7 @@ allowlist_externals =
description = Run high availability self healing integration tests
deps =
pytest
juju==2.9.11 # juju 3.0.0 has issues with retrieving action results
juju~=2.9.0 # Latest juju 2
landscape-api-py3
mailmanclient
pytest-operator
Expand All @@ -166,7 +166,7 @@ allowlist_externals =
description = Run password rotation integration tests
deps =
pytest
juju==2.9.11 # juju 3.0.0 has issues with retrieving action results
juju~=2.9.0 # Latest juju 2
landscape-api-py3
mailmanclient
pytest-operator
Expand All @@ -185,7 +185,7 @@ allowlist_externals =
description = Run TLS integration tests
deps =
pytest
juju==2.9.11 # juju 3.0.0 has issues with retrieving action results
juju~=2.9.0 # Latest juju 2
landscape-api-py3
mailmanclient
pytest-operator
Expand All @@ -204,7 +204,7 @@ allowlist_externals =
description = Run all integration tests
deps =
pytest
juju==2.9.11 # juju 3.0.0 has issues with retrieving action results
juju~=2.9.0 # Latest juju 2
landscape-api-py3
mailmanclient
pytest-operator
Expand Down