Skip to content

Commit

Permalink
[DPE-5711] Add warnings to destructive actions (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
sinclert-canonical authored Dec 9, 2024
1 parent 002767a commit cb486eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/kubernetes_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ def determine_partition() -> int:
action_event.fail(message)
return
if force:
logger.warning(f"Resume upgrade action ran with {force=}")
# If a unit was unhealthy and the upgrade was forced, only the next unit will
# upgrade. As long as 1 or more units are unhealthy, the upgrade will need to be
# forced for each unit.
Expand Down
8 changes: 4 additions & 4 deletions src/workload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -327,7 +327,7 @@ def _restart(self, *, event, tls: bool) -> None:

def _enable_router(self, *, event, tls: bool, unit_name: str) -> None:
"""Enable router after setting up all the necessary prerequisites."""
logger.debug("Enabling MySQL Router service")
logger.info("Enabling MySQL Router service")
self._cleanup_after_upgrade_or_potential_container_restart()
# create an empty credentials file, if the file does not exist
self._container.create_router_rest_api_credentials_file()
Expand All @@ -337,7 +337,7 @@ def _enable_router(self, *, event, tls: bool, unit_name: str) -> None:
)
self._container.update_mysql_router_service(enabled=True, tls=tls)
self._logrotate.enable()
logger.debug("Enabled MySQL Router service")
logger.info("Enabled MySQL Router service")
self._charm.wait_until_mysql_router_ready(event=event)

def _enable_exporter(
Expand Down

0 comments on commit cb486eb

Please sign in to comment.