Skip to content

Commit 92db570

Browse files
authored
Properly disable leader election (#2307)
Problem: NGF does not honor the `--leader-election-disable` command-line flag. Solution: Use the proper variable instead of a hardcoded boolean.
1 parent bfd25a5 commit 92db570

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/mode/static/manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ func createManager(cfg config.Config, nginxChecker *nginxConfiguredOnStartChecke
312312
// Note: when the leadership is lost, the manager will return an error in the Start() method.
313313
// However, it will not wait for any Runnable it starts to finish, meaning any in-progress operations
314314
// might get terminated half-way.
315-
LeaderElection: true,
315+
LeaderElection: cfg.LeaderElection.Enabled,
316316
LeaderElectionNamespace: cfg.GatewayPodConfig.Namespace,
317317
LeaderElectionID: cfg.LeaderElection.LockName,
318318
// We're not enabling LeaderElectionReleaseOnCancel because when the Manager stops gracefully, it waits

0 commit comments

Comments
 (0)