Skip to content

Commit 854987c

Browse files
committed
Address comments.
1 parent e7a2bbf commit 854987c

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

pkg/config/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ type Controller struct {
6060
// Defaults to true, which means the controller will use leader election.
6161
NeedLeaderElection *bool
6262

63-
// EnableWarmup indicates whether the controller needs to use warm up.
63+
// NeedWarmup indicates whether the controller needs to use warm up.
6464
// Defaults to false, which means the controller will not use warm up.
6565
NeedWarmup *bool
6666

pkg/controller/controller.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,11 @@ type TypedOptions[request comparable] struct {
9494
// Note: This flag is disabled by default until a future version. It's currently in beta.
9595
UsePriorityQueue *bool
9696

97-
// NeedWarmup specifies whether the controller should start its sources
98-
// when the manager is not the leader.
99-
// Defaults to false, which means that the controller will wait for leader election to start
100-
// before starting sources.
97+
// NeedWarmup specifies whether the controller should start its sources when the manager is not
98+
// the leader. When set to true, the controller will not restart its sources when/if it
99+
// transitions to be leader.
100+
//
101+
// Defaults to false.
101102
NeedWarmup *bool
102103
}
103104

pkg/manager/manager.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,11 @@ type LeaderElectionRunnable interface {
314314
NeedLeaderElection() bool
315315
}
316316

317-
// WarmupRunnable knows if a Runnable should be a warmup runnable.
317+
// WarmupRunnable knows if a Runnable should be a warmup runnable. A warmup runnable is a runnable
318+
// that should be run when the manager is started, but before the leader election is acquired.
319+
// The expectation is that it will block startup until the warmup runnables have completed.
318320
type WarmupRunnable interface {
319-
// Warmup returns true if the Runnable should be run as warmup.
321+
// Warmup is called when the manager is started, but before the leader election is acquired.
320322
Warmup(context.Context) error
321323
}
322324

0 commit comments

Comments
 (0)