However, some of the controllers' functions could leverage the controller leader election mechanism that only needs to run on a process to handle it (for example, kubernetes_secret_controller). After that, we probably could remove the ownerID check logic inside the controller. This would make the controller code logic easier to understand.
Describe the items of the task (DoD, definition of done) you'd like.
[ ] summarize which controllers could move to leverage controller leader election mechanism.
[ ] refactor those controllers.
Additional context
Add any other context or screenshots about the task request here.
What's the task? Please describe.
Currently, only the upgrade procedure enables the controller leader election https://github.com/longhorn/longhorn-manager/blob/ceb3982/upgrade/upgrade.go#L92-L135.
However, some of the controllers' functions could leverage the controller leader election mechanism that only needs to run on a process to handle it (for example, kubernetes_secret_controller). After that, we probably could remove the
ownerID
check logic inside the controller. This would make the controller code logic easier to understand.Describe the items of the task (DoD, definition of done) you'd like.
Additional context Add any other context or screenshots about the task request here.