@@ -350,13 +350,17 @@ func (r *CollectorReconciler) SetupWithManager(mgr ctrl.Manager) error {
350
350
subscriptionsForTenant , subscriptionsToUpdate , err := r .getSubscriptionsForTenant (ctx , & tenant )
351
351
if err != nil {
352
352
logger .Error (errors .WithStack (err ), "failed listing subscriptions for collector, notifying collector anyways" )
353
- requests = addCollectorRequest (requests , tenant .Status .Collector )
353
+ if tenant .Status .Collector != "" {
354
+ requests = addCollectorRequest (requests , tenant .Status .Collector )
355
+ }
354
356
continue TenantLoop
355
357
}
356
358
357
359
for _ , s := range append (subscriptionsForTenant , subscriptionsToUpdate ... ) {
358
360
if s .Name == subscription .Name {
359
- requests = addCollectorRequest (requests , tenant .Status .Collector )
361
+ if tenant .Status .Collector != "" {
362
+ requests = addCollectorRequest (requests , tenant .Status .Collector )
363
+ }
360
364
continue TenantLoop
361
365
}
362
366
}
@@ -365,7 +369,9 @@ func (r *CollectorReconciler) SetupWithManager(mgr ctrl.Manager) error {
365
369
366
370
for _ , s := range subscriptionsToDisown {
367
371
if s .Name == subscription .Name {
368
- requests = addCollectorRequest (requests , tenant .Status .Collector )
372
+ if tenant .Status .Collector != "" {
373
+ requests = addCollectorRequest (requests , tenant .Status .Collector )
374
+ }
369
375
continue TenantLoop
370
376
}
371
377
}
0 commit comments