@@ -446,7 +446,9 @@ func (optr *Operator) Run(runContext context.Context, shutdownContext context.Co
446
446
defer optr .queue .ShutDown ()
447
447
defer optr .availableUpdatesQueue .ShutDown ()
448
448
defer optr .upgradeableQueue .ShutDown ()
449
- defer optr .configuration .Queue ().ShutDown ()
449
+ if optr .configuration != nil {
450
+ defer optr .configuration .Queue ().ShutDown ()
451
+ }
450
452
stopCh := runContext .Done ()
451
453
452
454
klog .Infof ("Starting ClusterVersionOperator with minimum reconcile period %s" , optr .minimumUpdateCheckInterval )
@@ -459,6 +461,12 @@ func (optr *Operator) Run(runContext context.Context, shutdownContext context.Co
459
461
return fmt .Errorf ("caches never synchronized: %w" , runContext .Err ())
460
462
}
461
463
464
+ if optr .configuration != nil {
465
+ if err := optr .configuration .Start (runContext ); err != nil {
466
+ return fmt .Errorf ("unable to initialize the CVO configuration controller: %v" , err )
467
+ }
468
+ }
469
+
462
470
// trigger the first cluster version reconcile always
463
471
optr .queue .Add (optr .queueKey ())
464
472
@@ -489,13 +497,9 @@ func (optr *Operator) Run(runContext context.Context, shutdownContext context.Co
489
497
resultChannelCount ++
490
498
go func () {
491
499
defer utilruntime .HandleCrash ()
492
- if err := optr .configuration .Start (runContext ); err != nil {
493
- utilruntime .HandleError (fmt .Errorf ("unable to initialize the CVO configuration sync: %v" , err ))
494
- } else {
495
- wait .UntilWithContext (runContext , func (runContext context.Context ) {
496
- optr .worker (runContext , optr .configuration .Queue (), optr .configuration .Sync )
497
- }, time .Second )
498
- }
500
+ wait .UntilWithContext (runContext , func (runContext context.Context ) {
501
+ optr .worker (runContext , optr .configuration .Queue (), optr .configuration .Sync )
502
+ }, time .Second )
499
503
resultChannel <- asyncResult {name : "cvo configuration" }
500
504
}()
501
505
} else {
@@ -571,7 +575,9 @@ func (optr *Operator) Run(runContext context.Context, shutdownContext context.Co
571
575
optr .queue .ShutDown ()
572
576
optr .availableUpdatesQueue .ShutDown ()
573
577
optr .upgradeableQueue .ShutDown ()
574
- optr .configuration .Queue ().ShutDown ()
578
+ if optr .configuration != nil {
579
+ optr .configuration .Queue ().ShutDown ()
580
+ }
575
581
}
576
582
}
577
583
0 commit comments