Skip to content

Commit 4bc3811

Browse files
committed
🐛 Fix RenewDeadline typo in leader election
Signed-off-by: Vince Prignano <[email protected]>
1 parent 0170742 commit 4bc3811

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

pkg/leaderelection/leader_election.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ type Options struct {
4949
// will use for holding the leader lock.
5050
LeaderElectionID string
5151

52-
// RewnewDeadline is the renew deadline for this leader election client
53-
RewnewDeadline time.Duration
52+
// RenewDeadline is the renew deadline for this leader election client
53+
RenewDeadline time.Duration
5454
}
5555

5656
// NewResourceLock creates a new resource lock for use in a leader election loop.
@@ -99,7 +99,7 @@ func NewResourceLock(config *rest.Config, recorderProvider recorder.Provider, op
9999
EventRecorder: recorderProvider.GetEventRecorderFor(id),
100100
},
101101
config,
102-
options.RewnewDeadline,
102+
options.RenewDeadline,
103103
)
104104
}
105105

pkg/manager/manager.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ func New(config *rest.Config, options Options) (Manager, error) {
389389
LeaderElectionResourceLock: options.LeaderElectionResourceLock,
390390
LeaderElectionID: options.LeaderElectionID,
391391
LeaderElectionNamespace: options.LeaderElectionNamespace,
392-
RewnewDeadline: *options.RenewDeadline,
392+
RenewDeadline: *options.RenewDeadline,
393393
})
394394
if err != nil {
395395
return nil, err

pkg/manager/manager_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,8 @@ var _ = Describe("manger.Manager", func() {
324324
LeaderElectionNamespace: "default",
325325
LeaderElectionID: "test-leader-election-id",
326326
newResourceLock: func(config *rest.Config, recorderProvider recorder.Provider, options leaderelection.Options) (resourcelock.Interface, error) {
327-
if options.RewnewDeadline != 10*time.Second {
328-
return nil, fmt.Errorf("expected RenewDeadline to be 10s, got %v", options.RewnewDeadline)
327+
if options.RenewDeadline != 10*time.Second {
328+
return nil, fmt.Errorf("expected RenewDeadline to be 10s, got %v", options.RenewDeadline)
329329
}
330330
var err error
331331
rl, err = leaderelection.NewResourceLock(config, recorderProvider, options)

0 commit comments

Comments
 (0)