Skip to content

Commit

Permalink
add refresh events
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldmitry committed Sep 2, 2024
1 parent 4fa95dd commit 95b1b0a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "cosl"
version = "0.0.26"
version = "0.0.27"
authors = [
{ name="sed-i", email="82407168+sed-i@users.noreply.github.com" },
]
Expand Down
4 changes: 3 additions & 1 deletion src/cosl/coordinated_workers/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ def __init__(
certificates_relation_name=self._endpoints["certificates"],
# let's assume we don't need the peer relation as all coordinator charms will assume juju secrets
key="coordinator-server-cert",
sans=[self.hostname],
# update certificate with new SANs whenever a worker is added/removed
sans=[self.hostname, *self.cluster.gather_addresses()],
refresh_events=[self.cluster.on.changed],
)

self.s3_requirer = S3Requirer(self._charm, self._endpoints["s3"], s3_bucket_name)
Expand Down
5 changes: 3 additions & 2 deletions src/cosl/coordinated_workers/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
import re
import socket
import subprocess
import urllib.request
from enum import Enum
from functools import partial
Expand Down Expand Up @@ -491,8 +492,8 @@ def _update_tls_certificates(self) -> bool:
ROOT_CA_CERT.unlink(missing_ok=True)

# FIXME: uncomment as soon as the nginx image contains the ca-certificates package
# self._container.exec(["update-ca-certificates", "--fresh"]).wait()
# subprocess.run(["update-ca-certificates", "--fresh"])
self._container.exec(["update-ca-certificates", "--fresh"]).wait()
subprocess.run(["update-ca-certificates", "--fresh"])

return True

Expand Down

0 comments on commit 95b1b0a

Please sign in to comment.