@@ -61,8 +61,7 @@ type leaderElection struct {
6161 // the namespace to store the lock resource
6262 namespace string
6363 // resourceLock defines the type of leaderelection that should be used
64- // valid options are resourcelock.LeasesResourceLock, resourcelock.EndpointsResourceLock,
65- // and resourcelock.ConfigMapsResourceLock
64+ // Only resourcelock.LeasesResourceLock is valid at the moment.
6665 resourceLock string
6766 // healthCheck reports unhealthy if leader election fails to renew leadership
6867 // within a timeout period.
@@ -95,32 +94,6 @@ func NewLeaderElectionWithLeases(clientset kubernetes.Interface, lockName string
9594 }
9695}
9796
98- // NewLeaderElectionWithEndpoints returns an implementation of leader election using Endpoints
99- func NewLeaderElectionWithEndpoints (clientset kubernetes.Interface , lockName string , runFunc func (ctx context.Context )) * leaderElection {
100- return & leaderElection {
101- runFunc : runFunc ,
102- lockName : lockName ,
103- resourceLock : resourcelock .EndpointsResourceLock ,
104- leaseDuration : defaultLeaseDuration ,
105- renewDeadline : defaultRenewDeadline ,
106- retryPeriod : defaultRetryPeriod ,
107- clientset : clientset ,
108- }
109- }
110-
111- // NewLeaderElectionWithConfigMaps returns an implementation of leader election using ConfigMaps
112- func NewLeaderElectionWithConfigMaps (clientset kubernetes.Interface , lockName string , runFunc func (ctx context.Context )) * leaderElection {
113- return & leaderElection {
114- runFunc : runFunc ,
115- lockName : lockName ,
116- resourceLock : resourcelock .ConfigMapsResourceLock ,
117- leaseDuration : defaultLeaseDuration ,
118- renewDeadline : defaultRenewDeadline ,
119- retryPeriod : defaultRetryPeriod ,
120- clientset : clientset ,
121- }
122- }
123-
12497func (l * leaderElection ) WithIdentity (identity string ) {
12598 l .identity = identity
12699}
0 commit comments