Skip to content

Commit

Permalink
Operator leader election: use Leases only (#6717)
Browse files Browse the repository at this point in the history
  • Loading branch information
barkbay authored Apr 25, 2023
1 parent 7711946 commit c137ba0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const (
DefaultWebhookName = "elastic-webhook.k8s.elastic.co"
WebhookPort = 9443

LeaderElectionConfigMapName = "elastic-operator-leader"
LeaderElectionLeaseName = "elastic-operator-leader"

debugHTTPShutdownTimeout = 5 * time.Second // time to allow for the debug HTTP server to shutdown
)
Expand Down Expand Up @@ -527,8 +527,8 @@ func startOperator(ctx context.Context) error {
Scheme: clientgoscheme.Scheme,
CertDir: viper.GetString(operator.WebhookCertDirFlag),
LeaderElection: viper.GetBool(operator.EnableLeaderElection),
LeaderElectionResourceLock: resourcelock.ConfigMapsLeasesResourceLock, // TODO: use 'lease' after operator is released with 'configmapsleases'
LeaderElectionID: LeaderElectionConfigMapName,
LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
LeaderElectionID: LeaderElectionLeaseName,
LeaderElectionNamespace: operatorNamespace,
Logger: log.WithName("eck-operator"),
}
Expand Down

0 comments on commit c137ba0

Please sign in to comment.