Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

controllers, monitoring: use local variable for logger #1272

Conversation

ykaliuta
Copy link
Contributor

@ykaliuta ykaliuta commented Oct 2, 2024

Prepare to switch to dynamic logger. It can be k8s contextual logging [1] or some internal one. Copy reconciler's logger into local variables.

Just to avoid polluting the other patch with the replacements.

[1] https://www.kubernetes.dev/blog/2022/05/25/contextual-logging/

Description

How Has This Been Tested?

Screenshot or short clip

Merge criteria

  • You have read the contributors guide.
  • Commit messages are meaningful - have a clear and concise summary and detailed explanation of what was changed and why.
  • Pull Request contains a description of the solution, a link to the JIRA issue, and to any dependent or related Pull Request.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

Prepare to switch to dynamic logger. It can be k8s contextual
logging [1] or some internal one. Copy reconciler's logger into
local variables.

Just to avoid polluting the other patch with the replacements.

[1] https://www.kubernetes.dev/blog/2022/05/25/contextual-logging/

Signed-off-by: Yauheni Kaliuta <[email protected]>
@openshift-ci openshift-ci bot requested review from adelton and asanzgom October 2, 2024 07:03
@ykaliuta
Copy link
Contributor Author

ykaliuta commented Oct 2, 2024

/cc @zdtsw

@openshift-ci openshift-ci bot requested a review from zdtsw October 2, 2024 07:03
Copy link

openshift-ci bot commented Oct 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lburgazzoli

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Oct 2, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit d788daf into opendatahub-io:incubation Oct 2, 2024
8 checks passed
Copy link
Member

@zdtsw zdtsw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adelton
Copy link
Contributor

adelton commented Oct 2, 2024

Do we assume those log := r.Log will eventually be replaced by initializing some other loggers, completely independent from those r.Logs?

@ykaliuta
Copy link
Contributor Author

ykaliuta commented Oct 2, 2024

Do we assume those log := r.Log will eventually be replaced by initializing some other loggers, completely independent from those r.Logs?

Yes, as it's written in the commit message.

Like a897dac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants