@@ -482,26 +482,26 @@ var _ = Describe("controller.Controller", func() {
482
482
// Test with ShouldWarmupWithoutLeadership set to true
483
483
ctrlWithWarmup , err := controller .New ("warmup-enabled-ctrl" , m , controller.Options {
484
484
Reconciler : reconcile .Func (nil ),
485
- ShouldWarmupWithoutLeadership : ptr .To (true ),
485
+ NeedWarmup : ptr .To (true ),
486
486
})
487
487
Expect (err ).NotTo (HaveOccurred ())
488
488
489
489
internalCtrlWithWarmup , ok := ctrlWithWarmup .(* internalcontroller.Controller [reconcile.Request ])
490
490
Expect (ok ).To (BeTrue ())
491
- Expect (internalCtrlWithWarmup .ShouldWarmupWithoutLeadership ).NotTo (BeNil ())
492
- Expect (* internalCtrlWithWarmup .ShouldWarmupWithoutLeadership ).To (BeTrue ())
491
+ Expect (internalCtrlWithWarmup .NeedWarmup ).NotTo (BeNil ())
492
+ Expect (* internalCtrlWithWarmup .NeedWarmup ).To (BeTrue ())
493
493
494
494
// Test with ShouldWarmupWithoutLeadership set to false
495
495
ctrlWithoutWarmup , err := controller .New ("warmup-disabled-ctrl" , m , controller.Options {
496
496
Reconciler : reconcile .Func (nil ),
497
- ShouldWarmupWithoutLeadership : ptr .To (false ),
497
+ NeedWarmup : ptr .To (false ),
498
498
})
499
499
Expect (err ).NotTo (HaveOccurred ())
500
500
501
501
internalCtrlWithoutWarmup , ok := ctrlWithoutWarmup .(* internalcontroller.Controller [reconcile.Request ])
502
502
Expect (ok ).To (BeTrue ())
503
- Expect (internalCtrlWithoutWarmup .ShouldWarmupWithoutLeadership ).NotTo (BeNil ())
504
- Expect (* internalCtrlWithoutWarmup .ShouldWarmupWithoutLeadership ).To (BeFalse ())
503
+ Expect (internalCtrlWithoutWarmup .NeedWarmup ).NotTo (BeNil ())
504
+ Expect (* internalCtrlWithoutWarmup .NeedWarmup ).To (BeFalse ())
505
505
506
506
// Test with ShouldWarmupWithoutLeadership not set (should default to nil)
507
507
ctrlWithDefaultWarmup , err := controller .New ("warmup-default-ctrl" , m , controller.Options {
@@ -511,14 +511,14 @@ var _ = Describe("controller.Controller", func() {
511
511
512
512
internalCtrlWithDefaultWarmup , ok := ctrlWithDefaultWarmup .(* internalcontroller.Controller [reconcile.Request ])
513
513
Expect (ok ).To (BeTrue ())
514
- Expect (internalCtrlWithDefaultWarmup .ShouldWarmupWithoutLeadership ).To (BeNil ())
514
+ Expect (internalCtrlWithDefaultWarmup .NeedWarmup ).To (BeNil ())
515
515
})
516
516
517
517
It ("should inherit ShouldWarmupWithoutLeadership from manager config" , func () {
518
518
// Test with manager default setting ShouldWarmupWithoutLeadership to true
519
519
managerWithWarmup , err := manager .New (cfg , manager.Options {
520
520
Controller : config.Controller {
521
- NeedWarmUp : ptr .To (true ),
521
+ NeedWarmup : ptr .To (true ),
522
522
},
523
523
})
524
524
Expect (err ).NotTo (HaveOccurred ())
@@ -529,23 +529,20 @@ var _ = Describe("controller.Controller", func() {
529
529
530
530
internalCtrlInheritingWarmup , ok := ctrlInheritingWarmup .(* internalcontroller.Controller [reconcile.Request ])
531
531
Expect (ok ).To (BeTrue ())
532
- // Note: This test will fail until the DefaultFromConfig method is updated to set
533
- // ShouldWarmupWithoutLeadership from config.Controller.NeedWarmUp
534
- // This test demonstrates that the feature needs to be completed
535
- Expect (internalCtrlInheritingWarmup .ShouldWarmupWithoutLeadership ).NotTo (BeNil ())
536
- Expect (* internalCtrlInheritingWarmup .ShouldWarmupWithoutLeadership ).To (BeTrue ())
532
+ Expect (internalCtrlInheritingWarmup .NeedWarmup ).NotTo (BeNil ())
533
+ Expect (* internalCtrlInheritingWarmup .NeedWarmup ).To (BeTrue ())
537
534
538
535
// Test that explicit controller setting overrides manager setting
539
536
ctrlOverridingWarmup , err := controller .New ("override-warmup-disabled" , managerWithWarmup , controller.Options {
540
537
Reconciler : reconcile .Func (nil ),
541
- ShouldWarmupWithoutLeadership : ptr .To (false ),
538
+ NeedWarmup : ptr .To (false ),
542
539
})
543
540
Expect (err ).NotTo (HaveOccurred ())
544
541
545
542
internalCtrlOverridingWarmup , ok := ctrlOverridingWarmup .(* internalcontroller.Controller [reconcile.Request ])
546
543
Expect (ok ).To (BeTrue ())
547
- Expect (internalCtrlOverridingWarmup .ShouldWarmupWithoutLeadership ).NotTo (BeNil ())
548
- Expect (* internalCtrlOverridingWarmup .ShouldWarmupWithoutLeadership ).To (BeFalse ())
544
+ Expect (internalCtrlOverridingWarmup .NeedWarmup ).NotTo (BeNil ())
545
+ Expect (* internalCtrlOverridingWarmup .NeedWarmup ).To (BeFalse ())
549
546
})
550
547
})
551
548
})
0 commit comments