Skip to content

Commit

Permalink
remove builder pattern for leader election due to unexported struct
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsykim committed Apr 2, 2019
1 parent 9c9ae5f commit 0b0a149
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions leaderelection/leader_election.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,29 +107,24 @@ func NewLeaderElectionWithConfigMaps(clientset kubernetes.Interface, lockName st
}
}

func (l *leaderElection) WithIdentity(identity string) *leaderElection {
func (l *leaderElection) WithIdentity(identity string) {
l.identity = identity
return l
}

func (l *leaderElection) WithNamespace(namespace string) *leaderElection {
func (l *leaderElection) WithNamespace(namespace string) {
l.namespace = namespace
return l
}

func (l *leaderElection) WithLeaseDuration(leaseDuration time.Duration) *leaderElection {
func (l *leaderElection) WithLeaseDuration(leaseDuration time.Duration) {
l.leaseDuration = leaseDuration
return l
}

func (l *leaderElection) WithRenewDeadline(renewDeadline time.Duration) *leaderElection {
func (l *leaderElection) WithRenewDeadline(renewDeadline time.Duration) {
l.renewDeadline = renewDeadline
return l
}

func (l *leaderElection) WithRetryPeriod(retryPeriod time.Duration) *leaderElection {
func (l *leaderElection) WithRetryPeriod(retryPeriod time.Duration) {
l.retryPeriod = retryPeriod
return l
}

func (l *leaderElection) Run() error {
Expand Down

0 comments on commit 0b0a149

Please sign in to comment.