You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The restart_exporter() method will return ops.ErrorStatus("...") in some situations, and this is used to set the unit status.
However, this doesn't work - Juju will return a ERROR invalid status "error", expected one of [maintenance blocked waiting active] error, which ops will turn into a ModelError. The charm does end up in an error state, but because setting the status crashed, not because you've explicitly set the error state.
This is caught by the existing unit tests if you run with ops >= 2.10 (because Harness now models the Juju behaviour).
The text was updated successfully, but these errors were encountered:
@Pjack#157 works around this issue, but it doesn't actually fix it (and it stops you from getting any further improvements in ops until this is properly fixed). If you want the Charm to die with an error state, then there are cleaner ways of doing that. I think you probably want some other status though - most likely BlockedStatus - unless you are looking for specific error behaviour (like Juju retrying).
The restart_exporter() method will return
ops.ErrorStatus("...")
in some situations, and this is used to set the unit status.However, this doesn't work - Juju will return a
ERROR invalid status "error", expected one of [maintenance blocked waiting active]
error, which ops will turn into aModelError
. The charm does end up in an error state, but because setting the status crashed, not because you've explicitly set the error state.This is caught by the existing unit tests if you run with ops >= 2.10 (because Harness now models the Juju behaviour).
The text was updated successfully, but these errors were encountered: