Skip to content

Commit 3f4bda1

Browse files
dhaiducekopenshift-merge-robot
authored andcommitted
Remove legacy leader election
ref: https://issues.redhat.com/browse/ACM-5042 Signed-off-by: Dale Haiducek <[email protected]>
1 parent d2ce01e commit 3f4bda1

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

main.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -219,16 +219,6 @@ func main() {
219219
),
220220
}
221221

222-
if tool.Options.LegacyLeaderElection {
223-
// If legacyLeaderElection is enabled, then that means the lease API is not available.
224-
// In this case, use the legacy leader election method of a ConfigMap.
225-
mgrOptionsBase.LeaderElectionResourceLock = "configmaps"
226-
} else {
227-
// use the leases leader election by default for controller-runtime 0.11 instead of
228-
// the default of configmapsleases (leases is the new default in 0.12)
229-
mgrOptionsBase.LeaderElectionResourceLock = "leases"
230-
}
231-
232222
// This lease is not related to leader election. This is to report the status of the controller
233223
// to the addon framework. This can be seen in the "status" section of the ManagedClusterAddOn
234224
// resource objects.

tool/options.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ type SyncerOptions struct {
2121
DisableGkSync bool
2222
EnableLease bool
2323
EnableLeaderElection bool
24-
LegacyLeaderElection bool
2524
ProbeAddr string
2625
MetricsAddr string
2726
// The namespace that the replicated policies should be synced to. This defaults to the same namespace as on the
@@ -94,13 +93,6 @@ func ProcessFlags() {
9493
"Enabling this will ensure there is only one active controller manager.",
9594
)
9695

97-
flag.BoolVar(
98-
&Options.LegacyLeaderElection,
99-
"legacy-leader-elect",
100-
false,
101-
"Use a legacy leader election method for controller manager instead of the lease API.",
102-
)
103-
10496
flag.StringVar(
10597
&Options.ProbeAddr,
10698
"health-probe-bind-address",

0 commit comments

Comments
 (0)