Skip to content

Commit

Permalink
Dylan's suggestions addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
Abuelodelanada committed Dec 15, 2023
1 parent 563d632 commit eae1a55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ provides:
description: |
Send traces to tempo.
# FIXME: We need this relationship since it is needed by CertHandler
# Once this PR is merged https://github.com/canonical/observability-libs/pull/66
# we can remove it
peers:
replicas:
interface: coordinator_replica
6 changes: 5 additions & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def _on_config_changed(self, event):

def _on_server_cert_changed(self, _):
self._update_cert()
self._on_nginx_pebble_ready(_)
self._ensure_pebble_layer()
self.publish_config(tls=self._is_cert_available)

def publish_config(self, tls: bool = False):
Expand Down Expand Up @@ -169,12 +169,16 @@ def _on_loki_relation_changed(self, _):
pass

def _on_nginx_pebble_ready(self, _) -> None:
self._ensure_pebble_layer()

def _ensure_pebble_layer(self) -> None:
self._nginx_container.push(
self.nginx.config_path, self.nginx.config(tls=self._is_cert_available), make_dirs=True
)
self._nginx_container.add_layer("nginx", self.nginx.layer, combine=True)
self._nginx_container.autostart()


def _update_cert(self):
if not self._nginx_container.can_connect():
return
Expand Down

0 comments on commit eae1a55

Please sign in to comment.