Non-leader units are not receiving the database events emitted by the requires library. This way they cannot know when the database credentials are received.
Solution
Remove the checks about the unit being the leader and also move some data, like the diff (data field) and the alias fields to the unit databag (currently, they are part of the application databag).
Testing
Existing unit and integration tests were fixed.
One of the existing unit tests (test_database_events) was updated to ensure that the events are emitted to both leader and non-leader units.
Release Notes
Allow non-leader units to receive library events and database credentials.
Issue
Non-leader units are not receiving the database events emitted by the requires library. This way they cannot know when the database credentials are received.
Solution
Remove the checks about the unit being the leader and also move some data, like the diff (data field) and the alias fields to the unit databag (currently, they are part of the application databag).
Testing
test_database_events
) was updated to ensure that the events are emitted to both leader and non-leader units.Release Notes