363 Commits

Author SHA1 Message Date
Benjamin Wang
a9864d4edb etcdctl: update the description for flag '--rev'
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-06-02 15:53:08 +08:00
cui fliter
0c919dc212 use the more efficient strings.Builder
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-05-19 10:44:58 +08:00
James Blair
91a5f01a4e
Add detailed long description for etcdctl txn.
Include an example stdin usage and a link for full docs.

Signed-off-by: James Blair <mail@jamesblair.net>
2023-03-17 11:38:56 +13:00
Benjamin Wang
1f0d361848 clientv3: support serializable MemberList operation
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-02-25 07:23:39 +08:00
Piotr Tabor
6f899a7b40
Merge pull request #15052 from ptabor/20221228-goimports-fix
./scripts/fix.sh: Takes care of goimports across the whole project.
2022-12-29 11:31:22 +01:00
Piotr Tabor
9e1abbab6e Fix goimports in all existing files. Execution of ./scripts/fix.sh
Signed-off-by: Piotr Tabor <ptab@google.com>
2022-12-29 09:41:31 +01:00
wafuwafu13
0c67e318d7 enhancement(ctlv3): display as learner when member add as learner
Signed-off-by: wafuwafu13 <mariobaske@i.softbank.jp>
2022-12-29 13:18:23 +09:00
Unai Arrien
8a75cfff67 Improve memberList output consistency
Signed-off-by: Unai Arrien <unaittxu@gmail.com>
2022-12-19 13:09:19 +01:00
Benjamin Wang
9a7f9609d6 etcdctl: changed 'revision' to 'hash_revision' in hashkv table output
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-25 18:59:49 +08:00
Benjamin Wang
48b8210044 etcdctl: display HashRevision for 127.0.0.1:2379, 1084519789 command
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-25 18:49:16 +08:00
Sasha Melentyev
c3b6cbdb73 all: goimports -w .
Signed-off-by: Sasha Melentyev <sasha@melentyev.io>
2022-11-17 19:07:04 +03:00
Sasha Melentyev
2c9c209eb6 all: Changing Printf and friends to Print if there is no formatting
Signed-off-by: Sasha Melentyev <sasha@melentyev.io>
2022-11-15 22:11:23 +03:00
Benjamin Wang
74085136b3 etcdctl: connect to the same endpoint as the target to be maintained
The client may connect to a different endpint as the target to be
maintained. When auth is enabled, the target endpoint might haven't
finished applying the authentiation request, so it might reject the
corresponding maintenance request due to permission denied.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-03 04:55:27 +08:00
demoManito
72cf0cc04a etcd: modify declaring empty slices
declare an empty slice to var s []int replace  s :=[]int{}, https://github.com/golang/go/wiki/CodeReviewComments#declaring-empty-slices

Signed-off-by: demoManito <1430482733@qq.com>
2022-09-16 14:41:14 +08:00
Thomas Jungblut
3fc16608f7 etcdctl: fix move-leader for multiple endpoints
Due to a duplicate call of clientConfigFromCmd, the move-leader command
would fail with "conflicting environment variable is shadowed by corresponding command-line flag".
Also in scenarios where no command-line flag was supplied.

Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
2022-09-09 10:38:13 +02:00
Benjamin Wang
ff6b85da83
Merge pull request #14340 from xakdwch/main
etcdctl: add --max-txn-ops flag to make-mirror command
2022-08-17 05:36:16 +08:00
xakdwch
7cc3f5f97e etcdctl: add --max-txn-ops flag to make-mirror command
--max-txn-ops flag allows users to define the maximum number of operations permitted in
a transaction during syncing updates.if unlimited syncing may fail when number of txn ops
exceeds the maximum number of server side.

Signed-off-by: xakdwch <xakdwch5@gmail.com>
2022-08-15 13:38:32 +08:00
Benjamin Wang
5cae1a1c48 Print clusterID, memberID and leaseID in hexdecimal
ClusterID, memberID and leaseID are just identifies, so it doesn't
make sense to print them in decimal. Instead, we should always print
them in hexdecimal.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-07-16 07:21:13 +08:00
Mikel Olasagasti Uranga
89637a4223 Tools/benchmark: migrate cheggaaa/pb.v1 to cheggaaa/pb/v3
etcdctl/ctlv3: migrate cheggaaa/pb.v1 to cheggaaa/pb/v3

This commit also changes the format of the progress bar, from using a
custom progress bar to the default provided by the library.

Old behaviour:

./benchmarkv1  put
 0 / 10000 B                                                   !   0.00%
 3987 / 10000 Boooooooooooooom                                 !  39.87%
 10000 / 10000 Boooooooooooooooooooooooooooooooooooooooooooo! 100.00% 1s

New behaviour:

./benchmark put
 6536 / 10000 [----------------------->________________] 65.36% 7053 p/s
10000 / 10000 [---------------------------------------] 100.00% 7581 p/s

Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
2022-06-20 15:47:23 +02:00
Eduardo Patrocinio
e1e3ed11e3 Doc: provide more clarify to the usage of check perf command
This PR describes the fact that different workloads in the `check perf` command
are different, and the results might vary.

Signed-off-by: Eduardo Patrocinio <epatro@gmail.com>
2022-06-17 13:13:58 -03:00
Kun Zhang
657a197bfa add range flag for delete in etcdctl 2022-05-17 11:17:42 +08:00
ahrtr
beeb44d4ee hide the revision field when it isn't populated 2022-05-13 19:40:57 +08:00
Vimal Kumar
55f0c96fa0 tests: Migrate Txn tests to common functional test framework 2022-05-11 10:33:47 +05:30
Marek Siarkowicz
63346bfead server: Use default logging configuration instead of zap production one
This fixes problem where logs json changes format of timestamp.
2022-04-01 10:23:42 +02:00
ahrtr
f978da4f4f move the newClientCfg into clientv3 package so as to be reused by both etcdctl and v3discovery 2022-03-24 06:18:25 +08:00
Sahdev Zala
3254125e6c
Merge pull request #13809 from kkkkun/cleanup-deprecated-commands
Removing deprecated commands in etcdctl & etcdutl
2022-03-23 11:21:01 -04:00
Kun Zhang
1649c9dfc2 Removing deprecated commands in etcdctl & etcdutl 2022-03-23 11:05:52 +08:00
ahrtr
3780435831 added unit test for newClientCfg 2022-03-22 19:07:40 +08:00
ahrtr
edce939f6e add one more field storageVersion into StatusResponse
When performing the downgrade operation, users can confirm whether each member
is ready to be downgraded using the field 'storageVersion'. If it's equal to the
'target version' in the downgrade command, then it's ready to be downgraded;
otherwise, the etcd member is still in progress of processing the db file.
2022-03-18 07:04:44 +08:00
Sahdev Zala
fa4859f86a
Merge pull request #13793 from kkkkun/delete-defrag-offline-ctlv3
delete offline defrag in etcdctl
2022-03-15 12:23:54 -04:00
kkkkun
8c0e4fe559 delete offline defrag in etcdctl 2022-03-14 11:07:57 +08:00
ahrtr
1a3822f2c3 Rename ClientConfig to ConfigSpec
The ClientConfig is a fully declarive configuration, so it makes more
sense to rename it to ConfigSpec. It can also mitigate the confusion
between Config and ClientConfig.
2022-03-13 05:41:49 +08:00
ahrtr
3dcbbf62d9 Move clientconfig into clientv3 so that it can be reused by both etcdctl and v3 discovery 2022-03-12 06:38:41 +08:00
Marek Siarkowicz
6af760131e
Merge pull request #13687 from serathius/etcdctl
Add downgrade commands
2022-02-22 17:12:23 +01:00
Marek Siarkowicz
42faf9fe06 etcdctl: Use minor versions for downgrade 2022-02-22 16:30:08 +01:00
ahrtr
5d3847577f always print the raft_term in decimal even flag --hex is provided 2022-02-22 09:00:24 +08:00
Marek Siarkowicz
d0c1c3a1fd client: Alias downgrade action enum 2022-02-21 17:58:20 +01:00
Marek Siarkowicz
22ee50e005 etcdctl: Fix target version not provided message 2022-02-21 17:58:20 +01:00
leoyang.yl
8e71ebf071 Add downgrade commands 2022-02-21 17:58:19 +01:00
richkun
95ae9c19f0
Show db in use when print endpoint status (#13639) 2022-01-29 19:01:45 -08:00
Piotr Tabor
19cb0a4252
Merge pull request #13519 from ahrtr/enhance_make_mirror_command
Add a new flag "--rev" to make-mirror command to support incremental mirror
2022-01-15 17:02:12 +01:00
Michael Hoffmann
357006172d
ctlv3: add forgotten member promote method to printerRPC
The printerRPC struct was missing a MemberPromote method, leading to
panic in ectdctl when trying to print it as JSON. This PR fixes that
panic.
2022-01-14 12:53:09 +01:00
ahrtr
661e0a91ef added a new flag --rev to make-mirror command to support incremental mirror 2021-12-22 16:59:44 +08:00
ahrtr
8b3405bdb8 etcdctl: enhance the make-mirror command to return error asap with wrong command line parameters 2021-11-30 06:26:11 +08:00
qsyqian
eccabd237b etcdctl/ctlv3/command: add use time for defrag command 2021-11-16 22:39:31 +08:00
Eng Zer Jun
2a151c8982
*: move from io/ioutil to io and os packages
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-10-28 00:05:28 +08:00
Mario Valderrama
6eabc41aee etcdctl: add command to generate shell completion
To improve the UX of etcdctl. Completion is generated by cobra
according to defined commands and flags.

Fixes #13111
2021-06-22 13:29:23 +02:00
Marek Siarkowicz
e1b1d93548 *: Snapshot returns local etcd version
Co-authored-by: Lili Cosic <cosiclili@gmail.com>
2021-06-14 16:36:50 +02:00
赵延
64b01a7a8d
Enhance the root permission, when root role exist, it always return rootPerm. (#13006)
etcdctl role grant-permission root readwrite foo.
see etcdctl role get root output.
Before:
Role root
KV Read:
        foo
KV Write:
        foo
After:
Role root
KV Read:
        [, <open ended>
KV Write:
        [, <open ended>
2021-05-24 14:58:00 -07:00
horizonzy
6ab56fc237 enhance GetRole output when role is 'root' and the response perm is nil.
Before output:
Role root
KV Read:
KV Write:

After output:
Role root
KV Read:
	[, <open ended>
KV Write:
	[, <open ended>
2021-05-19 17:35:13 +08:00