Skip to content

Client: Rename etcdClientDebugLevel function to the ClientLogLevel #20006

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

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

Conversation

dmvolod
Copy link

@dmvolod dmvolod commented May 21, 2025

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

This PR allows to external projects to utilize this function during custom logger creation to align functionality with internal ETCD client logic.
Fox example Kubernetes copy/paste this function about 2 years ago, but now it's not up to date. It's better to import it and have up to date always.
Also Cluster API requires this function too.

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dmvolod
Once this PR has been reviewed and has the lgtm label, please assign ahrtr for approval. For more information see the 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

@k8s-ci-robot
Copy link

Hi @dmvolod. Thanks for your PR.

I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@serathius
Copy link
Member

/ok-to-test

// etcdClientDebugLevel translates ETCD_CLIENT_DEBUG into zap log level.
func etcdClientDebugLevel() zapcore.Level {
// EtcdClientDebugLevel translates ETCD_CLIENT_DEBUG into zap log level.
func EtcdClientDebugLevel() zapcore.Level {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should rename it to make sense for a public function? Fact that we depend on environment variable called "DEBUG" doesn't really make sense. For me this is a function to determine the log level for etcd client.

Maybe something like ClientLogLevel()

Copy link
Author

Choose a reason for hiding this comment

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

Yes, good point, thanks.
Will do.

@dmvolod dmvolod force-pushed the export-etcd-client-debug-level-func branch from 7caaaba to 073dadc Compare May 22, 2025 11:03
@dmvolod dmvolod changed the title Client: Export EtcdClientDebugLevel function Client: Rename etcdClientDebugLevel function to the ClientLogLevel May 22, 2025
@dmvolod
Copy link
Author

dmvolod commented May 22, 2025

/cherrypick release-3.5

@dmvolod
Copy link
Author

dmvolod commented May 22, 2025

/cherrypick release-3.6

@k8s-infra-cherrypick-robot

@dmvolod: only etcd-io org members may request cherry picks. If you are already part of the org, make sure to change your membership to public. Otherwise you can still do the cherry-pick manually.

In response to this:

/cherrypick release-3.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-infra-cherrypick-robot

@dmvolod: only etcd-io org members may request cherry picks. If you are already part of the org, make sure to change your membership to public. Otherwise you can still do the cherry-pick manually.

In response to this:

/cherrypick release-3.6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@dmvolod
Copy link
Author

dmvolod commented May 22, 2025

@serathius please request cherry-pick to the 3.5 and 3.6 versions.
Thank you.

Copy link

codecov bot commented May 22, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 68.80%. Comparing base (a119975) to head (073dadc).
Report is 27 commits behind head on main.

Files with missing lines Patch % Lines
client/v3/logger.go 50.00% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
client/v3/client.go 85.29% <100.00%> (ø)
client/v3/logger.go 27.77% <50.00%> (ø)

... and 18 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #20006      +/-   ##
==========================================
+ Coverage   68.78%   68.80%   +0.01%     
==========================================
  Files         424      424              
  Lines       35764    35764              
==========================================
+ Hits        24601    24608       +7     
+ Misses       9739     9737       -2     
+ Partials     1424     1419       -5     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a119975...073dadc. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@serathius
Copy link
Member

@serathius please request cherry-pick to the 3.5 and 3.6 versions.
Thank you.

I would prefer we don't backport a feature, especially to v3.5. Backport for v3.6 would depend on the impact, however if K8s has already copied the function I think they can just wait until we release v3.7.

@dmvolod
Copy link
Author

dmvolod commented May 22, 2025

I would prefer we don't backport a feature, especially to v3.5. Backport for v3.6 would depend on the impact, however if K8s has already copied the function I think they can just wait until we release v3.7.

Yes, k8s as already copied the function, but very old implementation and now it's not working as expected for ETCD v3.5 and v3.6. Please backport if possible, I will replace it in some K8s when new ETCD version been release.
Cluster API still using ETCD v3.5 and will use for a long time.
Thanks in advance.

@k8s-ci-robot
Copy link

@dmvolod: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci-etcd-robustness-release36-amd64 073dadc link true /test ci-etcd-robustness-release36-amd64

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Successfully merging this pull request may close these issues.

4 participants