@@ -540,5 +540,40 @@ var _ = Describe("controller.Controller", func() {
540
540
Expect (ok ).To (BeTrue ())
541
541
Expect (internalCtrlOverridingWarmup .EnableWarmup ).To (HaveValue (BeFalse ()))
542
542
})
543
+
544
+ It ("should default ReconciliationTimeout from manager if unset" , func () {
545
+ m , err := manager .New (cfg , manager.Options {
546
+ Controller : config.Controller {ReconciliationTimeout : 30 * time .Second },
547
+ })
548
+ Expect (err ).NotTo (HaveOccurred ())
549
+
550
+ c , err := controller .New ("mgr-reconciliation-timeout" , m , controller.Options {
551
+ Reconciler : rec ,
552
+ })
553
+ Expect (err ).NotTo (HaveOccurred ())
554
+
555
+ ctrl , ok := c .(* internalcontroller.Controller [reconcile.Request ])
556
+ Expect (ok ).To (BeTrue ())
557
+
558
+ Expect (ctrl .ReconciliationTimeout ).To (Equal (30 * time .Second ))
559
+ })
560
+
561
+ It ("should not override an existing ReconciliationTimeout" , func () {
562
+ m , err := manager .New (cfg , manager.Options {
563
+ Controller : config.Controller {ReconciliationTimeout : 30 * time .Second },
564
+ })
565
+ Expect (err ).NotTo (HaveOccurred ())
566
+
567
+ c , err := controller .New ("ctrl-reconciliation-timeout" , m , controller.Options {
568
+ Reconciler : rec ,
569
+ ReconciliationTimeout : time .Minute ,
570
+ })
571
+ Expect (err ).NotTo (HaveOccurred ())
572
+
573
+ ctrl , ok := c .(* internalcontroller.Controller [reconcile.Request ])
574
+ Expect (ok ).To (BeTrue ())
575
+
576
+ Expect (ctrl .ReconciliationTimeout ).To (Equal (time .Minute ))
577
+ })
543
578
})
544
579
})
0 commit comments