From d1894b60499213b7c4d1841c0d9b5009ee6c15da Mon Sep 17 00:00:00 2001 From: Carl Csaposs Date: Wed, 1 Nov 2023 09:30:08 +0000 Subject: [PATCH] Add info log with force option --- src/abstract_charm.py | 3 +++ src/machine_upgrade.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/abstract_charm.py b/src/abstract_charm.py index 84ba06fd..b3ac8aca 100644 --- a/src/abstract_charm.py +++ b/src/abstract_charm.py @@ -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`" ) diff --git a/src/machine_upgrade.py b/src/machine_upgrade.py index 0a3cb872..60760589 100644 --- a/src/machine_upgrade.py +++ b/src/machine_upgrade.py @@ -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`" )