@@ -90,7 +90,7 @@ func (r *BpfmanConfigReconciler) SetupWithManager(mgr ctrl.Manager) error {
9090
9191func (r * BpfmanConfigReconciler ) Reconcile (ctx context.Context , req ctrl.Request ) (ctrl.Result , error ) {
9292 r .Logger = ctrl .Log .WithName ("Config" )
93- r .Logger .Info ("Running the reconciler" )
93+ r .Logger .V ( 1 ). Info ("Running the reconciler" , "req.NamespacedName" , req . NamespacedName )
9494
9595 bpfmanConfig := & v1alpha1.Config {}
9696 // We must use types.NamespacedName{Name: req.NamespacedName.Name} instead of req.NamespacedName. Otherwise, the
@@ -114,7 +114,7 @@ func (r *BpfmanConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request
114114 // Ensure finalizer exists to prevent race conditions during
115115 // deletion.
116116 if ! controllerutil .ContainsFinalizer (bpfmanConfig , internal .BpfmanConfigFinalizer ) {
117- r .Logger .Info ("Adding finalizer to Config" , "name" , bpfmanConfig .Name )
117+ r .Logger .V ( 1 ). Info ("Adding finalizer to Config" , "name" , bpfmanConfig .Name )
118118 controllerutil .AddFinalizer (bpfmanConfig , internal .BpfmanConfigFinalizer )
119119 if err := r .Update (ctx , bpfmanConfig ); err != nil {
120120 r .Logger .Error (err , "Failed to add finalizer to Config" )
@@ -174,7 +174,7 @@ func (r *BpfmanConfigReconciler) reconcileCSIDriver(ctx context.Context, bpfmanC
174174 },
175175 ObjectMeta : metav1.ObjectMeta {Name : internal .BpfmanCsiDriverName },
176176 }
177- r .Logger .Info ("Loading object" , "object" , csiDriver .Name , "path" , r .CsiDriverDS )
177+ r .Logger .V ( 1 ). Info ("Loading object" , "object" , csiDriver .Name , "path" , r .CsiDriverDS )
178178 csiDriver , err := load (csiDriver , r .CsiDriverDS , csiDriver .Name )
179179 if err != nil {
180180 return err
@@ -193,7 +193,7 @@ func (r *BpfmanConfigReconciler) reconcileSCC(ctx context.Context, bpfmanConfig
193193 Name : internal .BpfmanRestrictedSccName ,
194194 },
195195 }
196- r .Logger .Info ("Loading object" , "object" , bpfmanRestrictedSCC .Name , "path" , r .RestrictedSCC )
196+ r .Logger .V ( 1 ). Info ("Loading object" , "object" , bpfmanRestrictedSCC .Name , "path" , r .RestrictedSCC )
197197 bpfmanRestrictedSCC , err := load (bpfmanRestrictedSCC , r .RestrictedSCC , bpfmanRestrictedSCC .Name )
198198 if err != nil {
199199 return err
@@ -211,7 +211,7 @@ func (r *BpfmanConfigReconciler) reconcileStandardDS(ctx context.Context, bpfman
211211 },
212212 ObjectMeta : metav1.ObjectMeta {Name : internal .BpfmanDsName },
213213 }
214- r .Logger .Info ("Loading object" , "object" , bpfmanDS .Name , "path" , r .BpfmanStandardDS )
214+ r .Logger .V ( 1 ). Info ("Loading object" , "object" , bpfmanDS .Name , "path" , r .BpfmanStandardDS )
215215 bpfmanDS , err := load (bpfmanDS , r .BpfmanStandardDS , bpfmanDS .Name )
216216 if err != nil {
217217 return err
@@ -229,7 +229,7 @@ func (r *BpfmanConfigReconciler) reconcileMetricsProxyDS(ctx context.Context, bp
229229 },
230230 ObjectMeta : metav1.ObjectMeta {Name : internal .BpfmanMetricsProxyDsName },
231231 }
232- r .Logger .Info ("Loading object" , "object" , metricsProxyDS .Name , "path" , r .BpfmanMetricsProxyDS )
232+ r .Logger .V ( 1 ). Info ("Loading object" , "object" , metricsProxyDS .Name , "path" , r .BpfmanMetricsProxyDS )
233233 metricsProxyDS , err := load (metricsProxyDS , r .BpfmanMetricsProxyDS , metricsProxyDS .Name )
234234 if err != nil {
235235 return err
@@ -390,7 +390,7 @@ func assureResource[T client.Object](ctx context.Context, r *BpfmanConfigReconci
390390 return err
391391 }
392392
393- r .Logger .Info ("Patching object" ,
393+ r .Logger .V ( 1 ). Info ("Patching object" ,
394394 "type" , resource .GetObjectKind (), "namespace" , resource .GetNamespace (), "name" , resource .GetName ())
395395 if err := r .Patch (ctx , resource , client .Apply , client .ForceOwnership , client .FieldOwner (bpfmanConfig .Name )); err != nil {
396396 r .Logger .Error (err , "Failed patching object" ,
@@ -405,7 +405,7 @@ func assureResource[T client.Object](ctx context.Context, r *BpfmanConfigReconci
405405// removing the finalizer to allow Kubernetes garbage collection to
406406// proceed via owner references.
407407func (r * BpfmanConfigReconciler ) handleDeletion (ctx context.Context , config * v1alpha1.Config ) (ctrl.Result , error ) {
408- r .Logger .Info ("Config deletion requested, allowing Kubernetes garbage collection to proceed" ,
408+ r .Logger .V ( 1 ). Info ("Config deletion requested, allowing Kubernetes garbage collection to proceed" ,
409409 "name" , config .Name )
410410
411411 // No custom cleanup needed - all resources are managed via
@@ -417,7 +417,7 @@ func (r *BpfmanConfigReconciler) handleDeletion(ctx context.Context, config *v1a
417417 return ctrl.Result {}, err
418418 }
419419
420- r .Logger .Info ("Finalizer removed from Config, deletion will proceed" , "name" , config .Name )
420+ r .Logger .V ( 1 ). Info ("Finalizer removed from Config, deletion will proceed" , "name" , config .Name )
421421 return ctrl.Result {}, nil
422422}
423423
0 commit comments