@@ -323,22 +323,6 @@ func (o *Operator) handleDeletion(obj interface{}) {
323
323
return
324
324
}
325
325
326
- // Check the registry server
327
- checker := o .reconciler .ReconcilerForSource (catsrc )
328
- healthy , err := checker .CheckRegistryServer (catsrc )
329
- if err != nil {
330
- logger .WithError (err ).Warn ("error checking registry health" )
331
- } else if ! healthy {
332
- logger .Debug ("registry server unhealthy, updating catalog source" )
333
- catsrc .Status .RegistryServiceStatus = nil
334
- _ , err = o .client .OperatorsV1alpha1 ().CatalogSources (catsrc .GetNamespace ()).UpdateStatus (catsrc )
335
- if err == nil {
336
- logger .Debug ("successfully updated catalogsource registry status" )
337
- return
338
- }
339
- logger .WithError (err ).Warn ("error updating catalogsource registry status" )
340
- }
341
-
342
326
// Requeue CatalogSource
343
327
if err := o .catSrcQueueSet .Requeue (catsrc .GetName (), catsrc .GetNamespace ()); err != nil {
344
328
logger .WithError (err ).Warn ("error requeuing owner catalogsource" )
@@ -429,17 +413,22 @@ func (o *Operator) syncCatalogSources(obj interface{}) (syncError error) {
429
413
logger .Debug ("catsrc configmap state good, checking registry pod" )
430
414
}
431
415
432
- reconciler := o .reconciler .ReconcilerForSource (catsrc )
433
- if reconciler == nil {
416
+ srcReconciler := o .reconciler .ReconcilerForSource (catsrc )
417
+ if srcReconciler == nil {
434
418
// TODO: Add failure status on catalogsource and remove from sources
435
419
return fmt .Errorf ("no reconciler for source type %s" , catsrc .Spec .SourceType )
436
420
}
437
421
422
+ healthy , err := srcReconciler .CheckRegistryServer (catsrc )
423
+ if err != nil {
424
+ return err
425
+ }
426
+
438
427
// If registry pod hasn't been created or hasn't been updated since the last configmap update, recreate it
439
- if catsrc .Status .RegistryServiceStatus == nil || catsrc .Status .RegistryServiceStatus .CreatedAt .Before (& catsrc .Status .LastSync ) {
428
+ if ! healthy || catsrc .Status .RegistryServiceStatus == nil || catsrc .Status .RegistryServiceStatus .CreatedAt .Before (& catsrc .Status .LastSync ) {
440
429
logger .Debug ("ensuring registry server" )
441
430
442
- if err := reconciler .EnsureRegistryServer (out ); err != nil {
431
+ if err := srcReconciler .EnsureRegistryServer (out ); err != nil {
443
432
logger .WithError (err ).Warn ("couldn't ensure registry server" )
444
433
return err
445
434
}
@@ -914,7 +903,7 @@ func (o *Operator) createInstallPlan(namespace string, subs []*v1alpha1.Subscrip
914
903
func (o * Operator ) requeueSubscription (name , namespace string ) {
915
904
// we can build the key directly, will need to change if queue uses different key scheme
916
905
key := fmt .Sprintf ("%s/%s" , namespace , name )
917
- o .subQueue .AddRateLimited (key )
906
+ o .subQueue .Add (key )
918
907
return
919
908
}
920
909
0 commit comments