@@ -56,7 +56,7 @@ var _ = Describe("runnables", func() {
5656
5757 It ("should add WarmupRunnable to the Warmup and LeaderElection group" , func () {
5858 warmupRunnable := warmupRunnableFunc {
59- RunFunc : func (c context.Context ) error {
59+ StartFunc : func (c context.Context ) error {
6060 <- c .Done ()
6161 return nil
6262 },
@@ -72,8 +72,8 @@ var _ = Describe("runnables", func() {
7272 })
7373
7474 It ("should add WarmupRunnable that doesn't needs leader election to warmup group only" , func () {
75- warmupRunnable := combinedRunnable {
76- RunFunc : func (c context.Context ) error {
75+ warmupRunnable := leaderElectionAndWarmupRunnable {
76+ StartFunc : func (c context.Context ) error {
7777 <- c .Done ()
7878 return nil
7979 },
@@ -93,8 +93,8 @@ var _ = Describe("runnables", func() {
9393 })
9494
9595 It ("should add WarmupRunnable that needs leader election to Warmup and LeaderElection group, not Others" , func () {
96- warmupRunnable := combinedRunnable {
97- RunFunc : func (c context.Context ) error {
96+ warmupRunnable := leaderElectionAndWarmupRunnable {
97+ StartFunc : func (c context.Context ) error {
9898 <- c .Done ()
9999 return nil
100100 },
@@ -118,7 +118,7 @@ var _ = Describe("runnables", func() {
118118 var warmupExecuted atomic.Bool
119119
120120 warmupRunnable := warmupRunnableFunc {
121- RunFunc : func (c context.Context ) error {
121+ StartFunc : func (c context.Context ) error {
122122 <- c .Done ()
123123 return nil
124124 },
@@ -145,7 +145,7 @@ var _ = Describe("runnables", func() {
145145 expectedErr := fmt .Errorf ("expected warmup error" )
146146
147147 warmupRunnable := warmupRunnableFunc {
148- RunFunc : func (c context.Context ) error {
148+ StartFunc : func (c context.Context ) error {
149149 <- c .Done ()
150150 return nil
151151 },
@@ -354,29 +354,29 @@ var _ LeaderElectionRunnable = &leaderElectionRunnableFunc{}
354354// leaderElectionRunnableFunc is a helper struct that implements LeaderElectionRunnable
355355// for testing purposes.
356356type leaderElectionRunnableFunc struct {
357- RunFunc func (context.Context ) error
357+ StartFunc func (context.Context ) error
358358 NeedLeaderElectionFunc func () bool
359359}
360360
361361func (r leaderElectionRunnableFunc ) Start (ctx context.Context ) error {
362- return r .RunFunc (ctx )
362+ return r .StartFunc (ctx )
363363}
364364
365365func (r leaderElectionRunnableFunc ) NeedLeaderElection () bool {
366366 return r .NeedLeaderElectionFunc ()
367367}
368368
369- var _ WarmupRunnable = & warmupRunnableFunc {}
369+ var _ warmupRunnable = & warmupRunnableFunc {}
370370
371371// warmupRunnableFunc is a helper struct that implements WarmupRunnable
372372// for testing purposes.
373373type warmupRunnableFunc struct {
374- RunFunc func (context.Context ) error
374+ StartFunc func (context.Context ) error
375375 WarmupFunc func (context.Context ) error
376376}
377377
378378func (r warmupRunnableFunc ) Start (ctx context.Context ) error {
379- return r .RunFunc (ctx )
379+ return r .StartFunc (ctx )
380380}
381381
382382func (r warmupRunnableFunc ) Warmup (ctx context.Context ) error {
@@ -387,25 +387,25 @@ func (r warmupRunnableFunc) WaitForWarmupComplete(ctx context.Context) bool {
387387 return true
388388}
389389
390- // combinedRunnable implements both WarmupRunnable and LeaderElectionRunnable
391- type combinedRunnable struct {
392- RunFunc func (context.Context ) error
390+ // leaderElectionAndWarmupRunnable implements both WarmupRunnable and LeaderElectionRunnable
391+ type leaderElectionAndWarmupRunnable struct {
392+ StartFunc func (context.Context ) error
393393 WarmupFunc func (context.Context ) error
394394 NeedLeaderElectionFunc func () bool
395395}
396396
397- func (r combinedRunnable ) Start (ctx context.Context ) error {
398- return r .RunFunc (ctx )
397+ func (r leaderElectionAndWarmupRunnable ) Start (ctx context.Context ) error {
398+ return r .StartFunc (ctx )
399399}
400400
401- func (r combinedRunnable ) Warmup (ctx context.Context ) error {
401+ func (r leaderElectionAndWarmupRunnable ) Warmup (ctx context.Context ) error {
402402 return r .WarmupFunc (ctx )
403403}
404404
405- func (r combinedRunnable ) WaitForWarmupComplete (ctx context.Context ) bool {
405+ func (r leaderElectionAndWarmupRunnable ) WaitForWarmupComplete (ctx context.Context ) bool {
406406 return true
407407}
408408
409- func (r combinedRunnable ) NeedLeaderElection () bool {
409+ func (r leaderElectionAndWarmupRunnable ) NeedLeaderElection () bool {
410410 return r .NeedLeaderElectionFunc ()
411411}
0 commit comments