Skip to content

Commit

Permalink
🐛 Fix RenewDeadline typo in leader election
Browse files Browse the repository at this point in the history
Signed-off-by: Vince Prignano <[email protected]>
  • Loading branch information
vincepri committed Nov 30, 2024
1 parent 00173cf commit bbbc12b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pkg/leaderelection/leader_election.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ type Options struct {
// will use for holding the leader lock.
LeaderElectionID string

// RewnewDeadline is the renew deadline for this leader election client
RewnewDeadline time.Duration
// RenewDeadline is the renew deadline for this leader election client
RenewDeadline time.Duration
}

// NewResourceLock creates a new resource lock for use in a leader election loop.
Expand Down Expand Up @@ -99,7 +99,7 @@ func NewResourceLock(config *rest.Config, recorderProvider recorder.Provider, op
EventRecorder: recorderProvider.GetEventRecorderFor(id),
},
config,
options.RewnewDeadline,
options.RenewDeadline,
)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ func New(config *rest.Config, options Options) (Manager, error) {
LeaderElectionResourceLock: options.LeaderElectionResourceLock,
LeaderElectionID: options.LeaderElectionID,
LeaderElectionNamespace: options.LeaderElectionNamespace,
RewnewDeadline: *options.RenewDeadline,
RenewDeadline: *options.RenewDeadline,
})
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions pkg/manager/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ var _ = Describe("manger.Manager", func() {
LeaderElectionNamespace: "default",
LeaderElectionID: "test-leader-election-id",
newResourceLock: func(config *rest.Config, recorderProvider recorder.Provider, options leaderelection.Options) (resourcelock.Interface, error) {
if options.RewnewDeadline != 10*time.Second {
return nil, fmt.Errorf("expected RenewDeadline to be 10s, got %v", options.RewnewDeadline)
if options.RenewDeadline != 10*time.Second {
return nil, fmt.Errorf("expected RenewDeadline to be 10s, got %v", options.RenewDeadline)
}
var err error
rl, err = leaderelection.NewResourceLock(config, recorderProvider, options)
Expand Down

0 comments on commit bbbc12b

Please sign in to comment.