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

fix:Resolve deprecation warning for klogr.New in Metrics Server #5794

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

guopeng0
Copy link
Contributor

@guopeng0 guopeng0 commented May 11, 2024

Metrics Server: klogr.New is deprecated use textlogger.NewLogger instead

Checklist

Fixes #5732

Relates to #

Signed-off-by: Guo Peng <370090914@qq.com>
@guopeng0 guopeng0 requested a review from a team as a code owner May 11, 2024 08:43
@zroubalik
Copy link
Member

zroubalik commented May 17, 2024

/run-e2e internal
Update: You can check the progress here

Dockerfile.adapter Outdated Show resolved Hide resolved
cmd/adapter/main.go Outdated Show resolved Hide resolved
Signed-off-by: Guo Peng <370090914@qq.com>
Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

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

Could you please update docs for logs if there are any changes? https://github.com/kedacore/keda/blob/main/BUILD.md#setting-log-levels

@@ -60,6 +60,9 @@ spec:
- --logtostderr=true
- --stderrthreshold=ERROR
- --v=0
- --zap-log-level=info
Copy link
Member

Choose a reason for hiding this comment

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

why is this needed?

//
//nolint:staticcheck // SA1019: klogr.New is deprecated.
var logger = klogr.New().WithName("keda_metrics_adapter")
var setupLog = ctrl.Log.WithName("keda_metrics_adapter")
Copy link

Choose a reason for hiding this comment

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

I understand that klogr.New is deprecated, but I was wondering if there's a specific reason for introducing setupLog instead of reusing logger variable?

Would it be possible to update the code to consistently use logger without introducing setupLog?

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

Successfully merging this pull request may close these issues.

Metrics Server: klogr.New is deprecated use textlogger.NewLogger instead
4 participants