@@ -333,7 +333,7 @@ func (r *NovaSchedulerReconciler) Reconcile(ctx context.Context, req ctrl.Reques
333333func (r * NovaSchedulerReconciler ) findObjectsForSrc (ctx context.Context , src client.Object ) []reconcile.Request {
334334 requests := []reconcile.Request {}
335335
336- l := log . FromContext (ctx ). WithName ( "Controllers" ). WithName ( "NovaScheduler" )
336+ Log := r . GetLogger (ctx )
337337
338338 for _ , field := range schedulerWatchFields {
339339 crList := & novav1.NovaSchedulerList {}
@@ -343,12 +343,12 @@ func (r *NovaSchedulerReconciler) findObjectsForSrc(ctx context.Context, src cli
343343 }
344344 err := r .Client .List (ctx , crList , listOps )
345345 if err != nil {
346- l .Error (err , fmt .Sprintf ("listing %s for field: %s - %s" , crList .GroupVersionKind ().Kind , field , src .GetNamespace ()))
346+ Log .Error (err , fmt .Sprintf ("listing %s for field: %s - %s" , crList .GroupVersionKind ().Kind , field , src .GetNamespace ()))
347347 return requests
348348 }
349349
350350 for _ , item := range crList .Items {
351- l .Info (fmt .Sprintf ("input source %s changed, reconcile: %s - %s" , src .GetName (), item .GetName (), item .GetNamespace ()))
351+ Log .Info (fmt .Sprintf ("input source %s changed, reconcile: %s - %s" , src .GetName (), item .GetName (), item .GetNamespace ()))
352352
353353 requests = append (requests ,
354354 reconcile.Request {
@@ -367,7 +367,7 @@ func (r *NovaSchedulerReconciler) findObjectsForSrc(ctx context.Context, src cli
367367func (r * NovaSchedulerReconciler ) findObjectsWithAppSelectorLabelInNamespace (ctx context.Context , src client.Object ) []reconcile.Request {
368368 requests := []reconcile.Request {}
369369
370- l := log . FromContext (ctx ). WithName ( "Controllers" ). WithName ( "NovaScheduler" )
370+ Log := r . GetLogger (ctx )
371371
372372 // if the endpoint has the service label and its in our endpointList, reconcile the CR in the namespace
373373 if svc , ok := src .GetLabels ()[common .AppSelector ]; ok && util .StringInSlice (svc , endpointList ) {
@@ -377,12 +377,12 @@ func (r *NovaSchedulerReconciler) findObjectsWithAppSelectorLabelInNamespace(ctx
377377 }
378378 err := r .Client .List (ctx , crList , listOps )
379379 if err != nil {
380- l .Error (err , fmt .Sprintf ("listing %s for namespace: %s" , crList .GroupVersionKind ().Kind , src .GetNamespace ()))
380+ Log .Error (err , fmt .Sprintf ("listing %s for namespace: %s" , crList .GroupVersionKind ().Kind , src .GetNamespace ()))
381381 return requests
382382 }
383383
384384 for _ , item := range crList .Items {
385- l .Info (fmt .Sprintf ("input source %s changed, reconcile: %s - %s" , src .GetName (), item .GetName (), item .GetNamespace ()))
385+ Log .Info (fmt .Sprintf ("input source %s changed, reconcile: %s - %s" , src .GetName (), item .GetName (), item .GetNamespace ()))
386386
387387 requests = append (requests ,
388388 reconcile.Request {
0 commit comments