Skip to content

Conversation

hwdef
Copy link
Contributor

@hwdef hwdef commented Aug 15, 2025

fix: #20466

before

./bin/etcdctl --help       
A simple command line client for etcd3.

Usage:
  etcdctl [command]

Key-value commands
  compaction  Compacts the event history in etcd
  del         Removes the specified key or range of keys [key, range_end)
  get         Gets the key or a range of keys
  lease       Lease related commands. Use `etcdctl lease --help` to see subcommands
  put         Puts the given key into the store
  txn         Txn processes all the requests in one transaction
  watch       Watches events stream on keys or prefixes

Cluster maintenance commands
  alarm       Alarm related commands. Use `etcdctl alarm --help` to see subcommands
  defrag      Defragments the storage of the etcd members with given endpoints
  downgrade   Downgrade related commands. Use `etcdctl downgrade --help` to see subcommands
  endpoint    Endpoint related commands. Use `etcdctl endpoint --help` to see subcommands
  member      Membership related commands. Use `etcdctl member --help` to see subcommands
  move-leader Transfers leadership to another etcd cluster member.
  snapshot    Manages etcd node snapshots

Concurrency commands
  elect       Observes and participates in leader election
  lock        Acquires a named lock

Authentication commands
  auth        Enable or disable authentication. Use `etcdctl auth --help` to see subcommands
  role        Role related commands. Use `etcdctl role --help` to see subcommands
  user        User related commands. Use `etcdctl user --help` to see subcommands

Utility commands
  check       commands for checking properties of the etcd cluster. Use `etcdctl check --help` to see subcommands
  completion  Generate completion script
  help        Help about any command
  make-mirror Makes a mirror at the destination etcd cluster
  version     Prints the version of etcdctl

Flags:
      --auth-jwt-token string        JWT token used for authentication (if this option is used, --user and --password should not be set)
      --cacert string                verify certificates of TLS-enabled secure servers using this CA bundle
      --cert string                  identify secure client using this TLS certificate file
      --command-timeout duration     timeout for short running command (excluding dial timeout) (default 5s)
      --debug                        enable client-side debug logging
      --dial-timeout duration        dial timeout for client connections (default 2s)
  -d, --discovery-srv string         domain name to query for SRV records describing cluster endpoints
      --discovery-srv-name string    service name to query when using DNS discovery
      --endpoints strings            gRPC endpoints (default [127.0.0.1:2379])
  -h, --help                         help for etcdctl
      --hex                          print byte strings as hex encoded strings
      --insecure-discovery           accept insecure SRV records describing cluster endpoints (default true)
      --insecure-skip-tls-verify     skip server certificate verification (CAUTION: this option should be enabled only for testing purposes)
      --insecure-transport           disable transport security for client connections (default true)
      --keepalive-time duration      keepalive time for client connections (default 2s)
      --keepalive-timeout duration   keepalive timeout for client connections (default 6s)
      --key string                   identify secure client using this TLS key file
      --max-recv-bytes int           client-side response receive limit in bytes (if 0, it defaults to "math.MaxInt32")
      --max-request-bytes int        client-side request send limit in bytes (if 0, it defaults to 2.0 MiB (2 * 1024 * 1024).)
      --password string              password for authentication (if this option is used, --user option shouldn't include password)
      --user string                  username[:password] for authentication (prompt if password is not supplied)
  -w, --write-out string             set the output format (fields, json, protobuf, simple, table) (default "simple")

Use "etcdctl [command] --help" for more information about a command.

after

$ ./bin/etcdctl --help  
A simple command line client for etcd3.

Usage:
  etcdctl [command]

Key-value commands
  compaction  Compacts the event history in etcd
  del         Removes the specified key or range of keys [key, range_end)
  get         Gets the key or a range of keys
  lease       Lease related commands. Use `etcdctl lease --help` to see subcommands
  put         Puts the given key into the store
  txn         Txn processes all the requests in one transaction
  watch       Watches events stream on keys or prefixes

Cluster maintenance commands
  alarm       Alarm related commands. Use `etcdctl alarm --help` to see subcommands
  defrag      Defragments the storage of the etcd members with given endpoints
  downgrade   Downgrade related commands. Use `etcdctl downgrade --help` to see subcommands
  endpoint    Endpoint related commands. Use `etcdctl endpoint --help` to see subcommands
  member      Membership related commands. Use `etcdctl member --help` to see subcommands
  move-leader Transfers leadership to another etcd cluster member.
  snapshot    Manages etcd node snapshots

Concurrency commands
  elect       Observes and participates in leader election
  lock        Acquires a named lock

Authentication commands
  auth        Enable or disable authentication. Use `etcdctl auth --help` to see subcommands
  role        Role related commands. Use `etcdctl role --help` to see subcommands
  user        User related commands. Use `etcdctl user --help` to see subcommands

Utility commands
  check       commands for checking properties of the etcd cluster. Use `etcdctl check --help` to see subcommands
  completion  Generate completion script
  help        Help about any command
  make-mirror Makes a mirror at the destination etcd cluster
  options     Show the global command-line flags
  version     Prints the version of etcdctl

Use "etcdctl [command] --help" for more information about a command.
Use "etcdctl options" for a list of global command-line options (applies to all commands).

@hwdef
Copy link
Contributor Author

hwdef commented Aug 15, 2025

cc @siyuanfoundation @ivanvc @jmhbnz

Copy link

codecov bot commented Aug 15, 2025

Codecov Report

❌ Patch coverage is 0% with 36 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@90653b3). Learn more about missing BASE report.
⚠️ Report is 190 commits behind head on main.

Files with missing lines Patch % Lines
etcdctl/ctlv3/command/options_command.go 0.00% 18 Missing ⚠️
etcdctl/ctlv3/ctl.go 0.00% 18 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
etcdctl/ctlv3/command/options_command.go 0.00% <0.00%> (ø)
etcdctl/ctlv3/ctl.go 0.00% <0.00%> (ø)
@@           Coverage Diff           @@
##             main   #20493   +/-   ##
=======================================
  Coverage        ?   68.90%           
=======================================
  Files           ?      416           
  Lines           ?    34600           
  Branches        ?        0           
=======================================
  Hits            ?    23842           
  Misses          ?     9338           
  Partials        ?     1420           

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 90653b3...55aea7b. Read the comment docs.

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

@hwdef hwdef force-pushed the hide-global-flags branch from 4522742 to b2ad78f Compare August 15, 2025 08:52
@hwdef hwdef force-pushed the hide-global-flags branch from b2ad78f to 55aea7b Compare August 15, 2025 09:03
Copy link
Member

@ivanvc ivanvc left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks, @hwdef.

@serathius
Copy link
Member

/cc @ahrtr

@k8s-ci-robot k8s-ci-robot requested a review from ahrtr August 21, 2025 09:11
Copy link
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks for the improvement.

Please also add a changelog item in a separate PR.

@@ -124,6 +130,27 @@ func MustStart() {
}
}

func hideAllPersistentFlags() {
Copy link
Member

Choose a reason for hiding this comment

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

nit, feel free to keep it as it's

Suggested change
func hideAllPersistentFlags() {
func hideAllGlobalFlags() {

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahrtr, hwdef, ivanvc, serathius

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 f514467 into etcd-io:main Aug 21, 2025
32 checks passed
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.

Hide the global flag of etcdctl
5 participants