Skip to content

Commit cfa8ae5

Browse files
authored
Merge pull request #551 from makhov/capi-leader-election-fix
Same LeaderElectionID fix
2 parents 3f984af + 5e09ec4 commit cfa8ae5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ limitations under the License.
1717
package main
1818

1919
import (
20+
"crypto/md5"
2021
"flag"
22+
"fmt"
2123
"os"
2224

2325
// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
@@ -110,7 +112,7 @@ func main() {
110112
},
111113
HealthProbeBindAddress: probeAddr,
112114
LeaderElection: enableLeaderElection,
113-
LeaderElectionID: "639dd9c3.k0smotron.io",
115+
LeaderElectionID: fmt.Sprintf("%x.k0smotron.io", md5.Sum([]byte(enabledController))),
114116
// LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily
115117
// when the Manager ends. This requires the binary to immediately end when the
116118
// Manager is stopped, otherwise, this setting is unsafe. Setting this significantly

0 commit comments

Comments
 (0)