Skip to content

Commit

Permalink
Remove legacy leader election
Browse files Browse the repository at this point in the history
ref: https://issues.redhat.com/browse/ACM-5042
Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
  • Loading branch information
dhaiducek authored and openshift-merge-robot committed May 8, 2023
1 parent d7cb435 commit 0e3e42c
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ type ctrlOpts struct {
evaluationConcurrency uint8
enableLease bool
enableLeaderElection bool
legacyLeaderElection bool
enableMetrics bool
}

Expand Down Expand Up @@ -243,18 +242,6 @@ func main() {
),
}

if opts.legacyLeaderElection {
// If legacyLeaderElection is enabled, then that means the lease API is not available.
// In this case, use the legacy leader election method of a ConfigMap.
log.Info("Using the legacy leader election of configmaps")

options.LeaderElectionResourceLock = "configmaps"
} else {
// use the leases leader election by default for controller-runtime 0.11 instead of
// the default of configmapsleases (leases is the new default in 0.12)
options.LeaderElectionResourceLock = "leases"
}

// Create a new manager to provide shared dependencies and start components
mgr, err := manager.New(cfg, options)
if err != nil {
Expand Down Expand Up @@ -485,13 +472,6 @@ func parseOpts(flags *pflag.FlagSet, args []string) *ctrlOpts {
"Enabling this will ensure there is only one active controller manager.",
)

flags.BoolVar(
&opts.legacyLeaderElection,
"legacy-leader-elect",
false,
"Use a legacy leader election method for controller manager instead of the lease API.",
)

flags.Uint8Var(
&opts.decryptionConcurrency,
"decryption-concurrency",
Expand Down

0 comments on commit 0e3e42c

Please sign in to comment.