File tree 3 files changed +16
-6
lines changed
3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ type Controller struct {
68
68
//
69
69
// Setting EnableWarmup to true and NeedLeaderElection to true means the controller will start its
70
70
// sources without waiting to become leader.
71
- // Setting EnableWarmup to true and NeedLeaderElection is false is a no-op as controllers without
71
+ // Setting EnableWarmup to true and NeedLeaderElection to false is a no-op as controllers without
72
72
// leader election do not wait on leader election to start their sources.
73
73
// Defaults to false.
74
74
EnableWarmup * bool
Original file line number Diff line number Diff line change @@ -100,7 +100,10 @@ type TypedOptions[request comparable] struct {
100
100
// improves leadership failover time, as the caches will be prepopulated before the controller
101
101
// transitions to be leader.
102
102
//
103
- // When set to true, the controller will start its sources without transitioning to be leader.
103
+ // Setting EnableWarmup to true and NeedLeaderElection to true means the controller will start its
104
+ // sources without waiting to become leader.
105
+ // Setting EnableWarmup to true and NeedLeaderElection to false is a no-op as controllers without
106
+ // leader election do not wait on leader election to start their sources.
104
107
// Defaults to false.
105
108
EnableWarmup * bool
106
109
}
Original file line number Diff line number Diff line change @@ -143,10 +143,17 @@ type Controller[request comparable] struct {
143
143
// LeaderElected indicates whether the controller is leader elected or always running.
144
144
LeaderElected * bool
145
145
146
- // EnableWarmup specifies whether the controller should start its sources
147
- // when the manager is not the leader.
148
- // Defaults to false, which means that the controller will wait for leader election to start
149
- // before starting sources.
146
+ // EnableWarmup specifies whether the controller should start its sources when the manager is not
147
+ // the leader. This is useful for cases where sources take a long time to start, as it allows
148
+ // for the controller to warm up its caches even before it is elected as the leader. This
149
+ // improves leadership failover time, as the caches will be prepopulated before the controller
150
+ // transitions to be leader.
151
+ //
152
+ // Setting EnableWarmup to true and NeedLeaderElection to true means the controller will start its
153
+ // sources without waiting to become leader.
154
+ // Setting EnableWarmup to true and NeedLeaderElection to false is a no-op as controllers without
155
+ // leader election do not wait on leader election to start their sources.
156
+ // Defaults to false.
150
157
EnableWarmup * bool
151
158
}
152
159
You can’t perform that action at this time.
0 commit comments