diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 53e53c6234..be853634fe 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -57,13 +57,13 @@ jobs: - agent: 2.9.51 # renovate: juju-agent-pin-minor libjuju: ==2.9.49.1 # renovate: latest libjuju 2 allure_on_amd64: false - - agent: 3.4.6 # renovate: juju-agent-pin-minor + - agent: 3.6.1 # renovate: juju-agent-pin-minor allure_on_amd64: true architecture: - amd64 include: - juju: - agent: 3.4.6 # renovate: juju-agent-pin-minor + agent: 3.6.1 # renovate: juju-agent-pin-minor allure_on_amd64: true architecture: arm64 name: Integration | ${{ matrix.juju.agent }} | ${{ matrix.architecture }} diff --git a/lib/charms/postgresql_k8s/v0/postgresql.py b/lib/charms/postgresql_k8s/v0/postgresql.py index 17adae9e61..d87854e98a 100644 --- a/lib/charms/postgresql_k8s/v0/postgresql.py +++ b/lib/charms/postgresql_k8s/v0/postgresql.py @@ -21,7 +21,7 @@ import logging from collections import OrderedDict -from typing import Optional, Set, Tuple +from typing import List, Optional, Set, Tuple import psycopg2 from ops.model import Relation @@ -35,7 +35,7 @@ # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 40 +LIBPATCH = 41 INVALID_EXTRA_USER_ROLE_BLOCKING_MESSAGE = "invalid role(s) for extra user roles" @@ -108,7 +108,7 @@ def __init__( user: str, password: str, database: str, - system_users: Optional[list[str]] = None, + system_users: Optional[List[str]] = None, ): self.primary_host = primary_host self.current_host = current_host @@ -161,8 +161,8 @@ def create_database( self, database: str, user: str, - plugins: Optional[list[str]] = None, - client_relations: Optional[list[Relation]] = None, + plugins: Optional[List[str]] = None, + client_relations: Optional[List[Relation]] = None, ) -> None: """Creates a new database and grant privileges to a user on it. diff --git a/lib/charms/postgresql_k8s/v0/postgresql_tls.py b/lib/charms/postgresql_k8s/v0/postgresql_tls.py index bdc7159a9d..a5c9696835 100644 --- a/lib/charms/postgresql_k8s/v0/postgresql_tls.py +++ b/lib/charms/postgresql_k8s/v0/postgresql_tls.py @@ -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 = 11 +LIBPATCH = 12 logger = logging.getLogger(__name__) SCOPE = "unit" @@ -136,6 +136,11 @@ def _on_certificate_available(self, event: CertificateAvailableEvent) -> None: self.charm.set_secret(SCOPE, "cert", event.certificate) self.charm.set_secret(SCOPE, "ca", event.ca) + if not event.certificate: + logger.debug("Cannot push TLS certificates at this moment") + event.defer() + return + try: if not self.charm.push_tls_files_to_workload(): logger.debug("Cannot push TLS certificates at this moment") diff --git a/poetry.lock b/poetry.lock index f01f60d5e5..b25d373311 100644 --- a/poetry.lock +++ b/poetry.lock @@ -120,6 +120,17 @@ files = [ {file = "backoff-2.2.1.tar.gz", hash = "sha256:03f829f5bb1923180821643f8753b0502c3b682293992485b0eef2807afa5cba"}, ] +[[package]] +name = "backports-strenum" +version = "1.3.1" +description = "Base class for creating enumerated constants that are also subclasses of str" +optional = false +python-versions = ">=3.8.6,<3.11" +files = [ + {file = "backports_strenum-1.3.1-py3-none-any.whl", hash = "sha256:cdcfe36dc897e2615dc793b7d3097f54d359918fc448754a517e6f23044ccf83"}, + {file = "backports_strenum-1.3.1.tar.gz", hash = "sha256:77c52407342898497714f0596e86188bb7084f89063226f4ba66863482f42414"}, +] + [[package]] name = "bcrypt" version = "4.2.1" @@ -612,17 +623,6 @@ wrapt = ">=1.10,<2" [package.extras] dev = ["PyTest", "PyTest-Cov", "bump2version (<1)", "jinja2 (>=3.0.3,<3.1.0)", "setuptools", "sphinx (<2)", "tox"] -[[package]] -name = "durationpy" -version = "0.9" -description = "Module for converting between datetime.timedelta and Go's Duration strings." -optional = false -python-versions = "*" -files = [ - {file = "durationpy-0.9-py3-none-any.whl", hash = "sha256:e65359a7af5cedad07fb77a2dd3f390f8eb0b74cb845589fa6c057086834dd38"}, - {file = "durationpy-0.9.tar.gz", hash = "sha256:fd3feb0a69a0057d582ef643c355c40d2fa1c942191f914d12203b1a01ac722a"}, -] - [[package]] name = "exceptiongroup" version = "1.2.2" @@ -947,17 +947,19 @@ referencing = ">=0.31.0" [[package]] name = "juju" -version = "3.5.2.1" +version = "3.6.1.0" description = "Python library for Juju" optional = false -python-versions = "*" +python-versions = ">=3.8.6" files = [ - {file = "juju-3.5.2.1.tar.gz", hash = "sha256:112da798b058d7cb23caffc5868c5c51e5f8a422ee1ab20006a090d396b90b0e"}, + {file = "juju-3.6.1.0-py3-none-any.whl", hash = "sha256:28b6a10093f2e0243ad0ddd5ef25a3f59d710e9da5a188456ba704142819fbb3"}, + {file = "juju-3.6.1.0.tar.gz", hash = "sha256:59cfde55185bb53877a2bddc2855f3c48471537e130653d77984681676a448bc"}, ] [package.dependencies] +"backports.strenum" = {version = ">=1.3.1", markers = "python_version < \"3.11\""} hvac = "*" -kubernetes = ">=12.0.1" +kubernetes = ">=12.0.1,<31.0.0" macaroonbakery = ">=1.1,<2.0" packaging = "*" paramiko = ">=2.4.0" @@ -965,23 +967,27 @@ pyasn1 = ">=0.4.4" pyRFC3339 = ">=1.0,<2.0" pyyaml = ">=5.1.2" toposort = ">=1.5,<2" +typing-extensions = ">=4.5.0" typing_inspect = ">=0.6.0" -websockets = ">=8.1,<14.0" +websockets = ">=13.0.1" + +[package.extras] +dev = ["Twine", "freezegun", "pytest", "pytest-asyncio", "typing-inspect"] +docs = ["sphinx (==5.3.0)", "sphinx_rtd_theme", "sphinxcontrib-asyncio"] [[package]] name = "kubernetes" -version = "31.0.0" +version = "30.1.0" description = "Kubernetes python client" optional = false python-versions = ">=3.6" files = [ - {file = "kubernetes-31.0.0-py2.py3-none-any.whl", hash = "sha256:bf141e2d380c8520eada8b351f4e319ffee9636328c137aa432bc486ca1200e1"}, - {file = "kubernetes-31.0.0.tar.gz", hash = "sha256:28945de906c8c259c1ebe62703b56a03b714049372196f854105afe4e6d014c0"}, + {file = "kubernetes-30.1.0-py2.py3-none-any.whl", hash = "sha256:e212e8b7579031dd2e512168b617373bc1e03888d41ac4e04039240a292d478d"}, + {file = "kubernetes-30.1.0.tar.gz", hash = "sha256:41e4c77af9f28e7a6c314e3bd06a8c6229ddd787cad684e0ab9f69b498e98ebc"}, ] [package.dependencies] certifi = ">=14.05.14" -durationpy = ">=0.7" google-auth = ">=1.0.1" oauthlib = ">=3.2.2" python-dateutil = ">=2.5.3" @@ -2482,4 +2488,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "238c47e10ea3a12da28fc15bc9257df87cd0584e38ebad092a2fd8213544006f" +content-hash = "2959d8b6afea18716251d1e8ba89ee1c9899bcc5180ae99be6b0f59848874b44" diff --git a/pyproject.toml b/pyproject.toml index 7f1a1d19bc..db49ae80d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,7 +70,7 @@ pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workf pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v24.0.5", subdirectory = "python/pytest_plugins/pytest_operator_groups"} allure-pytest-collection-report = {git = "https://github.com/canonical/data-platform-workflows", tag = "v24.0.5", subdirectory = "python/pytest_plugins/allure_pytest_collection_report"} # renovate caret doesn't work: https://github.com/renovatebot/renovate/issues/26940 -juju = "<=3.5.2.1" +juju = "<=3.6.1.0" psycopg2-binary = "^2.9.10" boto3 = "^1.35.70" tenacity = "^9.0.0"