Skip to content

Commit

Permalink
Merge branch 'main' into update-charmcraft-builder
Browse files Browse the repository at this point in the history
  • Loading branch information
merkata authored Jan 18, 2024
2 parents a9994a5 + 9c09b30 commit d45938e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion discourse_rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: discourse
summary: Discourse rock
description: Discourse OCI image for the Discourse charm
base: [email protected]
# renovate: base: ubuntu:22.04@sha256:6042500cf4b44023ea1894effe7890666b0c5c7871ed83a97c36c76ae560bb9b
# renovate: base: ubuntu:22.04@sha256:a2bbdf79d03f6d4171bbd6ebb4782f6229375951987d3427ec3d9373f9841cd7
run-user: _daemon_ # UID/GID 584792
license: Apache-2.0
version: "1.0"
Expand Down
10 changes: 9 additions & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def __init__(self, *args):
self._grafana_dashboards = GrafanaDashboardProvider(self)

self.restart_manager = RollingOpsManager(
charm=self, relation="restart", callback=self._setup_and_activate
charm=self, relation="restart", callback=self._on_rolling_restart
)

def _on_start(self, _: ops.StartEvent) -> None:
Expand Down Expand Up @@ -193,6 +193,14 @@ def _on_config_changed(self, _: HookEvent) -> None:
"""
self._configure_pod()

def _on_rolling_restart(self, _: ops.EventBase) -> None:
"""Handle rolling restart event.
Args:
event: Event triggering the discourse rolling restart event handler.
"""
self._setup_and_activate()

def _setup_and_activate(self) -> None:
"""Set up discourse, configure the pod and eventually activate the charm."""
if not self._is_setup_completed():
Expand Down

0 comments on commit d45938e

Please sign in to comment.