Skip to content

Commit 1789992

Browse files
vinceprik8s-infra-cherrypick-robot
authored andcommitted
bug: Fix RenewDeadline typo in leader election
Signed-off-by: Vince Prignano <[email protected]>
1 parent f5d202d commit 1789992

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

pkg/leaderelection/leader_election.go

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

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

0 commit comments

Comments
 (0)