Skip to content

Conversation

@simonpasquier
Copy link
Contributor

@simonpasquier simonpasquier commented Sep 3, 2024

Description

PR #6890 removed the final bits from go-kit/log in the operator code base but forgot to redirect the klog logs to the new slog logger. ResourceReconciler has a dependency on klog because it uses utilruntime.HandleError() when it fails to sync a resource. As a consequence, the operator didn't log reconciliation failures anymore.

I didn't qualify it as a bug because the latest operator version doesn't have the issue.

Type of change

What type of changes does your code introduce to the Prometheus operator? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Verification

Please check the Prometheus-Operator testing guidelines for recommendations about automated tests.

Changelog entry

Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.


PR prometheus-operator#6890 removed the final bits from go-kit/log in the operator code
base but forgot to redirect the klog logs to the new slog logger.
`ResourceReconciler` has a dependency on klog because it uses
`utilruntime.HandleError()` when it fails to sync a resource. As a
consequence, the operator didn't log reconciliation failures anymore.

Signed-off-by: Simon Pasquier <[email protected]>
@simonpasquier simonpasquier requested a review from a team as a code owner September 3, 2024 12:52
Copy link
Member

@ArthurSens ArthurSens left a comment

Choose a reason for hiding this comment

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

Nice catch and thanks for fixing it!

cc @perebaj for awareness!

@simonpasquier simonpasquier merged commit c35954f into prometheus-operator:main Sep 3, 2024
@simonpasquier simonpasquier deleted the bring-back-klog-bridge branch September 3, 2024 14:15
@simonpasquier
Copy link
Contributor Author

I found it while testing a failure case and I was like: "hmm it sure fails to reconcile but I see no log???"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants