Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: canonical/mysql-router-operator
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4f9e36c6e6ceac7d0317afa64f99fb990bce748a
Choose a base ref
..
head repository: canonical/mysql-router-operator
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f0fa9ced1c6c0e216c5057a3d62bd39182084482
Choose a head ref
Showing with 8 additions and 7 deletions.
  1. +3 −3 pyproject.toml
  2. +3 −2 src/machine_charm.py
  3. +2 −2 src/workload.py
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -55,9 +55,9 @@ pytest-mock = "^3.14.0"
[tool.poetry.group.integration.dependencies]
pytest = "^8.2.2"
pytest-operator = "^0.35.0"
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v22.0.0", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v22.0.0", subdirectory = "python/pytest_plugins/pytest_operator_groups"}
pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v22.0.0", subdirectory = "python/pytest_plugins/github_secrets"}
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v23.1.0", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v23.1.0", subdirectory = "python/pytest_plugins/pytest_operator_groups"}
pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v23.1.0", subdirectory = "python/pytest_plugins/github_secrets"}
juju = "^3.5.2.0"
mysql-connector-python = "~8.0.33"
tenacity = "^9.0.0"
5 changes: 3 additions & 2 deletions src/machine_charm.py
Original file line number Diff line number Diff line change
@@ -197,14 +197,15 @@ def _on_force_upgrade_action(self, event: ops.ActionEvent) -> None:
logger.debug(f"Force upgrade event failed: {message}")
event.fail(message)
return
logger.debug("Forcing upgrade")

logger.warning("Forcing upgrade")
event.log(f"Forcefully upgrading {self.unit.name}")
self._upgrade.upgrade_unit(
event=event, workload_=self.get_workload(event=None), tls=self._tls_certificate_saved
)
self.reconcile()
event.set_results({"result": f"Forcefully upgraded {self.unit.name}"})
logger.debug("Forced upgrade")
logger.warning("Forced upgrade")


if __name__ == "__main__":
4 changes: 2 additions & 2 deletions src/workload.py
Original file line number Diff line number Diff line change
@@ -145,14 +145,14 @@ def _disable_tls(self) -> None:

def _disable_router(self) -> None:
"""Disable router and clean up corresponding router files."""
logger.debug("Disabling MySQL Router service")
logger.info("Disabling MySQL Router service")
self._container.update_mysql_router_service(enabled=False)
self._logrotate.disable()
self._container.router_config_directory.rmtree()
self._container.router_config_directory.mkdir()
self._router_data_directory.rmtree()
self._router_data_directory.mkdir()
logger.debug("Disabled MySQL Router service")
logger.info("Disabled MySQL Router service")

def reconcile(
self,