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: switch to k8s contextual logger #1308

Open
wants to merge 1 commit into
base: incubation
Choose a base branch
from

Conversation

ykaliuta
Copy link
Contributor

@ykaliuta ykaliuta commented Oct 18, 2024

Jira: https://issues.redhat.com/browse/RHOAIENG-14096

This is a squashed commit of the following patches:

d012b67 ("controllers: switch to k8s contextual logger")
9880530 ("logger: blindly convert ctrl.Log users to contextual")

  • controllers: switch to k8s contextual logger

Remove own logger from controllers' reconcilers and switch to k8s contextual logger instead [1].

Use contextual logger for SecretGeneratorReconciler and CertConfigmapGeneratorReconciler setups as well.

Add name to the logger coming from the framework. It will contains "controller" field already, and like in webhook with the name it's easy to distinguish framework and operator messages.

  • logger: blindly convert ctrl.Log users to contextual

All the users should have proper context now. The log level changes will affect it as well.

[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

Copy link

openshift-ci bot commented Oct 18, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from ykaliuta. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@ykaliuta
Copy link
Contributor Author

/cc @zdtsw

@openshift-ci openshift-ci bot requested a review from zdtsw October 18, 2024 09:53
Jira: https://issues.redhat.com/browse/RHOAIENG-14096

This is a squashed commit of the following patches:

d012b67 ("controllers: switch to k8s contextual logger")
9880530 ("logger: blindly convert ctrl.Log users to contextual")

- controllers: switch to k8s contextual logger

Remove own logger from controllers' reconcilers and switch to k8s
contextual logger instead [1].

Use contextual logger for SecretGeneratorReconciler and
CertConfigmapGeneratorReconciler setups as well.

Add name to the logger coming from the framework. It will contains
"controller" field already, and like in webhook with the name it's
easy to distinguish framework and operator messages.

- logger: blindly convert ctrl.Log users to contextual

All the users should have proper context now. The log level changes
will affect it as well.

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

Signed-off-by: Yauheni Kaliuta <[email protected]>
Copy link

codecov bot commented Oct 18, 2024

Codecov Report

Attention: Patch coverage is 25.71429% with 26 lines in your changes missing coverage. Please review.

Please upload report for BASE (incubation@12fd9e5). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...atasciencecluster/datasciencecluster_controller.go 0.00% 9 Missing ⚠️
controllers/dscinitialization/monitoring.go 0.00% 6 Missing ⚠️
...lers/secretgenerator/secretgenerator_controller.go 0.00% 4 Missing ⚠️
pkg/cluster/resources.go 0.00% 4 Missing ⚠️
.../dscinitialization/dscinitialization_controller.go 50.00% 3 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             incubation    #1308   +/-   ##
=============================================
  Coverage              ?   17.50%           
=============================================
  Files                 ?       30           
  Lines                 ?     3360           
  Branches              ?        0           
=============================================
  Hits                  ?      588           
  Misses                ?     2710           
  Partials              ?       62           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Successfully merging this pull request may close these issues.

1 participant