canonical / admission-webhook-operator

Admission Webhook Operator
Apache License 2.0
1 stars 4 forks source link

Observe leader-elected event #22

Closed natalian98 closed 2 years ago

natalian98 commented 2 years ago

When we use juju upgrade-charm, a new non-leader unit gets created, then the old still-leader one gets removed, resulting in the new unit being elected as the leader. When the leader_elected event is not observed, the charm is not aware of having a leader now, so it remains stuck with message 'Waiting for leadership'. This PR adds a fix to observe this event.

Note that this charm doesn't have unit tests, I added that to issues.