Skip to content

Commit

Permalink
Add warnings when forcing upgrade (II)
Browse files Browse the repository at this point in the history
  • Loading branch information
sinclert-canonical committed Dec 4, 2024
1 parent c65a75b commit 9888ce7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 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 event 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 All @@ -232,12 +233,10 @@ def determine_partition() -> int:
# also applicable `if not force`, but is unlikely to happen since all units are
# healthy `if not force`.
message = f"Attempting to upgrade unit {self._partition}"
action_event.set_results({"result": message})
logger.warning(f"Resume upgrade event succeeded: {message}")
else:
message = f"Upgrade resumed. Unit {self._partition} is upgrading next"
action_event.set_results({"result": message})
logger.debug(f"Resume upgrade event succeeded: {message}")
action_event.set_results({"result": message})
logger.debug(f"Resume upgrade event succeeded: {message}")

@property
def authorized(self) -> bool:
Expand Down

0 comments on commit 9888ce7

Please sign in to comment.