Changed the way we set the unit status. Now, the unit status is evaluated in a post event hook handler and then set once per charm instantiation.
I am pretty sure that the original issues come from rollingops setting the application status, whereas our event handlers only set the unit status. After a successful restart, the application status would be set to Active until a new event triggered the rollingsops libs. With these changes, the same method handles both the unit and the application status. The best thing, in my opinion, would be to avoid setting the app status everywhere (including the libs), but that's a discussion for another time.
Migrated all unit tests to scenario V7. I took this opportunity to properly patch sys calls triggering the auth desktop portal when running locally. Now we can run the tests without being interrupted.
Fixed an issue where we would silently ignore rebalance actions on non-leader units by moving the action event listener before the init early return
Pro tip: I recommend using the side-by-side display option for the units tests (instead of the default unified), I find it easier on the eyes to keep track of what changed regardless of the boilerplate.
Changes:
Changed the way we set the unit status. Now, the unit status is evaluated in a post event hook handler and then set once per charm instantiation.
I am pretty sure that the original issues come from rollingops setting the application status, whereas our event handlers only set the unit status. After a successful restart, the application status would be set to Active until a new event triggered the rollingsops libs. With these changes, the same method handles both the unit and the application status. The best thing, in my opinion, would be to avoid setting the app status everywhere (including the libs), but that's a discussion for another time.
Migrated all unit tests to scenario V7. I took this opportunity to properly patch sys calls triggering the auth desktop portal when running locally. Now we can run the tests without being interrupted.
Fixed an issue where we would silently ignore rebalance actions on non-leader units by moving the action event listener before the init early return
Pro tip: I recommend using the side-by-side display option for the units tests (instead of the default unified), I find it easier on the eyes to keep track of what changed regardless of the boilerplate.