Skip to content

Commit

Permalink
Merge pull request k0sproject#551 from makhov/capi-leader-election-fix
Browse files Browse the repository at this point in the history
Same LeaderElectionID fix
  • Loading branch information
makhov authored Apr 25, 2024
2 parents 3f984af + 5e09ec4 commit cfa8ae5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ limitations under the License.
package main

import (
"crypto/md5"
"flag"
"fmt"
"os"

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

0 comments on commit cfa8ae5

Please sign in to comment.