Skip to content

Update 'endpoint health' command to avoid calling flags.SetPflagsFromEnv multiple times #20120

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

Merged
merged 1 commit into from
Jun 5, 2025

Conversation

ahrtr
Copy link
Member

@ahrtr ahrtr commented Jun 5, 2025

Fix #20118

Note both etcdctl endpoint health and etcdctl endpoint health --cluster have this issue.

flags.SetPflagsFromEnv should only be called once. It has already been called in clientConfigFromCmd, so there is no need to call it again in epHealthCommandFunc.

Also reverted #18742 to fix the etcdctl endpoint health --cluster issue

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

…Env multiple times

Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
@ahrtr
Copy link
Member Author

ahrtr commented Jun 5, 2025

cc @fuweid @ivanvc @jmhbnz @serathius

Let's get the fix included in v3.6.1

Copy link

codecov bot commented Jun 5, 2025

Codecov Report

Attention: Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.

Project coverage is 69.23%. Comparing base (ea5b603) to head (58dadb1).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
etcdctl/ctlv3/command/ep_command.go 0.00% 14 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
etcdctl/ctlv3/command/ep_command.go 0.00% <0.00%> (ø)

... and 24 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #20120      +/-   ##
==========================================
- Coverage   69.27%   69.23%   -0.04%     
==========================================
  Files         413      413              
  Lines       34354    34364      +10     
==========================================
- Hits        23799    23793       -6     
- Misses       9156     9175      +19     
+ Partials     1399     1396       -3     

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 ea5b603...58dadb1. Read the comment docs.

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

@ahrtr ahrtr requested review from ivanvc, serathius, fuweid and jmhbnz June 5, 2025 11:01
@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahrtr, fuweid

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

@ahrtr ahrtr merged commit 1934e11 into etcd-io:main Jun 5, 2025
33 checks passed
@ahrtr
Copy link
Member Author

ahrtr commented Jun 5, 2025

/cherry-pick release-3.6

@ahrtr ahrtr deleted the 20250605_ep_health branch June 5, 2025 11:47
@k8s-infra-cherrypick-robot

@ahrtr: new pull request created: #20121

In response to this:

/cherry-pick 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.

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.

3.6.0: If ETCDCTL_CACERT, ETCDCTL_CERT, ETCDCTL_KEY or ETCDCTL_ENDPOINTS are set, 'etcdctl endpoint health' will fail
4 participants