Skip to content

Commit

Permalink
Properly disable leader election (#2307)
Browse files Browse the repository at this point in the history
Problem: NGF does not honor the `--leader-election-disable` command-line flag.

Solution: Use the proper variable instead of a hardcoded boolean.
  • Loading branch information
sjberman authored Jul 29, 2024
1 parent bfd25a5 commit 92db570
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/mode/static/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func createManager(cfg config.Config, nginxChecker *nginxConfiguredOnStartChecke
// Note: when the leadership is lost, the manager will return an error in the Start() method.
// However, it will not wait for any Runnable it starts to finish, meaning any in-progress operations
// might get terminated half-way.
LeaderElection: true,
LeaderElection: cfg.LeaderElection.Enabled,
LeaderElectionNamespace: cfg.GatewayPodConfig.Namespace,
LeaderElectionID: cfg.LeaderElection.LockName,
// We're not enabling LeaderElectionReleaseOnCancel because when the Manager stops gracefully, it waits
Expand Down

0 comments on commit 92db570

Please sign in to comment.