Skip to content

Commit

Permalink
Use GetLogger for findObjectsForSrc
Browse files Browse the repository at this point in the history
  • Loading branch information
olliewalsh committed Feb 26, 2024
1 parent 5724e09 commit 4920182
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions controllers/ovncontroller_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func (r *OVNControllerReconciler) SetupWithManager(mgr ctrl.Manager, ctx context
func (r *OVNControllerReconciler) findObjectsForSrc(ctx context.Context, src client.Object) []reconcile.Request {
requests := []reconcile.Request{}

l := log.FromContext(ctx).WithName("Controllers").WithName("OVNController")
Log := r.GetLogger(ctx)

for _, field := range allWatchFields {
crList := &ovnv1.OVNControllerList{}
Expand All @@ -266,7 +266,7 @@ func (r *OVNControllerReconciler) findObjectsForSrc(ctx context.Context, src cli
}

for _, item := range crList.Items {
l.Info(fmt.Sprintf("input source %s changed, reconcile: %s - %s", src.GetName(), item.GetName(), item.GetNamespace()))
Log.Info(fmt.Sprintf("input source %s changed, reconcile: %s - %s", src.GetName(), item.GetName(), item.GetNamespace()))

requests = append(requests,
reconcile.Request{
Expand Down
4 changes: 2 additions & 2 deletions controllers/ovndbcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func (r *OVNDBClusterReconciler) SetupWithManager(mgr ctrl.Manager) error {
func (r *OVNDBClusterReconciler) findObjectsForSrc(ctx context.Context, src client.Object) []reconcile.Request {
requests := []reconcile.Request{}

l := log.FromContext(ctx).WithName("Controllers").WithName("OVNDBCluster")
Log := r.GetLogger(ctx)

for _, field := range allWatchFields {
crList := &ovnv1.OVNDBClusterList{}
Expand All @@ -256,7 +256,7 @@ func (r *OVNDBClusterReconciler) findObjectsForSrc(ctx context.Context, src clie
}

for _, item := range crList.Items {
l.Info(fmt.Sprintf("input source %s changed, reconcile: %s - %s", src.GetName(), item.GetName(), item.GetNamespace()))
Log.Info(fmt.Sprintf("input source %s changed, reconcile: %s - %s", src.GetName(), item.GetName(), item.GetNamespace()))

requests = append(requests,
reconcile.Request{
Expand Down
4 changes: 2 additions & 2 deletions controllers/ovnnorthd_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func (r *OVNNorthdReconciler) SetupWithManager(mgr ctrl.Manager, ctx context.Con
func (r *OVNNorthdReconciler) findObjectsForSrc(ctx context.Context, src client.Object) []reconcile.Request {
requests := []reconcile.Request{}

l := log.FromContext(ctx).WithName("Controllers").WithName("OVNNorthd")
Log := r.GetLogger(ctx)

for _, field := range allWatchFields {
crList := &ovnv1.OVNNorthdList{}
Expand All @@ -238,7 +238,7 @@ func (r *OVNNorthdReconciler) findObjectsForSrc(ctx context.Context, src client.
}

for _, item := range crList.Items {
l.Info(fmt.Sprintf("input source %s changed, reconcile: %s - %s", src.GetName(), item.GetName(), item.GetNamespace()))
Log.Info(fmt.Sprintf("input source %s changed, reconcile: %s - %s", src.GetName(), item.GetName(), item.GetNamespace()))

requests = append(requests,
reconcile.Request{
Expand Down

0 comments on commit 4920182

Please sign in to comment.