Skip to content

Commit

Permalink
Add info log with force option
Browse files Browse the repository at this point in the history
  • Loading branch information
carlcsaposs-canonical committed Mar 4, 2024
1 parent 51137bc commit d1894b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/abstract_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ def reconcile(self, event=None) -> None: # noqa: C901
workload_ = self.get_workload(event=event)
if self._upgrade.unit_state == "restarting": # Kubernetes only
if not self._upgrade.is_compatible:
logger.info(
"Upgrade incompatible. If you accept potential *data loss* and *downtime*, you can continue with `resume-upgrade force=true`"
)
self.unit.status = ops.BlockedStatus(
"Upgrade incompatible. Rollback to previous revision with `juju refresh`"
)
Expand Down
3 changes: 3 additions & 0 deletions src/machine_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ def _get_unit_healthy_status(
@property
def app_status(self) -> typing.Optional[ops.StatusBase]:
if not self.is_compatible:
logger.info(
"Upgrade incompatible. If you accept potential *data loss* and *downtime*, you can continue by running `force-upgrade` action on each remaining unit"
)
return ops.BlockedStatus(
"Upgrade incompatible. Rollback to previous revision with `juju refresh`"
)
Expand Down

0 comments on commit d1894b6

Please sign in to comment.