436 Commits

Author SHA1 Message Date
Hitoshi Mitake
a89c2512ea etcdctl, etcdmain: warn about --insecure-skip-tls-verify options 2020-06-22 19:53:45 -04:00
jingyih
c58133b2d4 etcdctl: fix member add command
Use members information from member add response, which is
guaranteed to be up to date.
2020-02-29 07:21:17 -08:00
Jingyi Hu
02a27c0851 etcdctl: fix member add command 2019-10-03 13:52:57 -07:00
Jingyi Hu
d005486359 ctlv3: add missing newline in EndpointHealth
To make the output consistent with the output before #9540.
2019-06-05 14:36:57 -07:00
Gyuho Lee
f835a85965 ctlv3: support "write-out" for "endpoint health" command
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2019-06-03 17:01:54 -07:00
Iskander Sharipov
e634184dc6 etcdctl: fix strings.HasPrefix args order
Signed-off-by: Iskander Sharipov <quasilyte@gmail.com>
2019-02-07 10:41:44 -08:00
Jingyi Hu
60d546e309 etcdctl: cherry pick of #10109 to release-3.3
Add snapshot file integrity verification in snapshot status.
2018-09-25 16:50:47 -07:00
Gyuho Lee
e2cb9cbaec ctlv3: support TLS endpoints for move-leader command
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-06-05 13:56:05 -07:00
Gyuho Lee
bc2d400b4c etcdctl/ctlv3: fix watch with exec commands
Following command was failing because the parser incorrectly
picks up the second "watch" string in exec command, thus
passing wrong exec commands.

```
ETCDCTL_API=3 ./bin/etcdctl watch aaa -- echo watch event received

panic: runtime error: slice bounds out of range

goroutine 1 [running]:
github.com/coreos/etcd/etcdctl/ctlv3/command.parseWatchArgs(0xc42002e080, 0x8, 0x8, 0xc420206a20, 0x5, 0x6, 0x0, 0x0, 0x0, 0x0, ...)
	/home/gyuho/go/src/github.com/coreos/etcd/etcdctl/ctlv3/command/watch_command.go:303 +0xbed
github.com/coreos/etcd/etcdctl/ctlv3/command.watchCommandFunc(0xc4202a7180, 0xc420206a20, 0x5, 0x6)
	/home/gyuho/go/src/github.com/coreos/etcd/etcdctl/ctlv3/command/watch_command.go:73 +0x11d
github.com/coreos/etcd/vendor/github.com/spf13/cobra.(*Command).execute(0xc4202a7180, 0xc420206960, 0x6, 0x6, 0xc4202a7180, 0xc420206960)
	/home/gyuho/go/src/github.com/coreos/etcd/vendor/github.com/spf13/cobra/command.go:766 +0x2c1
github.com/coreos/etcd/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x1363de0, 0xc420128638, 0xc420185e01, 0xc420185ee8)
	/home/gyuho/go/src/github.com/coreos/etcd/vendor/github.com/spf13/cobra/command.go:852 +0x30a
github.com/coreos/etcd/vendor/github.com/spf13/cobra.(*Command).Execute(0x1363de0, 0x0, 0x0)
	/home/gyuho/go/src/github.com/coreos/etcd/vendor/github.com/spf13/cobra/command.go:800 +0x2b
github.com/coreos/etcd/etcdctl/ctlv3.Start()
	/home/gyuho/go/src/github.com/coreos/etcd/etcdctl/ctlv3/ctl_nocov.go:25 +0x8e
main.main()
	/home/gyuho/go/src/github.com/coreos/etcd/etcdctl/main.go:40 +0x17b
```

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-03 18:48:08 -07:00
Gyuho Lee
1bc974d536 etcdctl: highlight "defrag" command caveats
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-03-05 11:15:02 -08:00
Gyuho Lee
7974f008f3 etcdctl: document "ETCD_WATCH_*"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-17 12:44:22 -08:00
Gyuho Lee
6340564c84 ctlv3: set ETCD_WATCH_* on watch exec
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-17 12:43:55 -08:00
Gyuho Lee
6735028ec0 ctlv3: exit on exec watch error
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-17 12:43:45 -08:00
Gyuho Lee
906f098053 ctlv3: set ETCD_WATCH_KEY, ETCD_WATCH_VALUE on exec watch
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-17 12:43:38 -08:00
Gyuho Lee
8a66237693 ctlv3: handle pkg/flags warnings
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-17 12:43:27 -08:00
Gyuho Lee
d37afffb98 etcdctl: document watch with ETCDCTL_WATCH_*
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-17 12:43:12 -08:00
Gyuho Lee
ad4df985fc ctlv3: support ETCDCTL_WATCH_KEY, ETCDCTL_WATCH_RANGE_END
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-17 12:42:54 -08:00
Hitoshi Mitake
6178c45066 etcdctl: don't ask password twice for etcdctl endpoint health --cluster
Current etcdctl endpoint health --cluster asks password twice if auth
is enabled. This is because the command creates two client instances:
one for the purpose of checking endpoint health and another for
getting cluster members with MemberList(). The latter client doesn't
need to be authenticated because MemberList() is a public RPC. This
commit makes the client with no authed one.

Fix https://github.com/coreos/etcd/issues/9094
2018-01-12 09:59:31 -08:00
Gyuho Lee
ee3c81d8d3 ctlv3: add "snapshot restore --wal-dir"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-09 11:12:29 -08:00
Gyuho Lee
22127895d8
Merge pull request #8919 from gyuho/exec-watch
etcdctl: support exec watch in v3
2017-12-20 10:53:30 -08:00
Gyuho Lee
f59808a2ca etcdctl: update README for new "lease timetolive" output
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2017-12-20 06:55:23 -08:00
Gyuho Lee
9978b4fd35 etcdctl/ctlv3: clarify "lease timetolive" output on expired lease
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2017-12-20 00:40:57 -08:00
Gyu-Ho Lee
e89fc20542 etcdctl: document watch exec in v3
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-12-19 19:45:27 -08:00
Gyu-Ho Lee
904513fa5c etcdctl/ctlv3: support "exec-watch" in watch command
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-12-19 19:45:24 -08:00
Gyu-Ho Lee
deb514989c etcdctl/ctlv3: disable grpc client logs when --debug is off
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-11-11 20:52:33 -08:00
Gyu-Ho Lee
75110dd839 *: fix naked returns
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-11-10 18:46:15 -08:00
zhesi.huang
0ce02abf59 etcdctl: fix snapshot status accidentally modified the db file 2017-11-09 01:07:48 +08:00
marco
aaf4a70cd0 etcdctl v3: e2e test for the --once option to the lease keep-alive command
Follow up #8775
2017-10-27 08:48:22 +01:00
marco
cb188d0b26 etcdctl v3: adds the --once option to the lease keep-alive command
Fixes: #8719
2017-10-27 00:27:11 +01:00
Jeffrey Gensler
7ffcca5946 etcdctl: close snapshot backend to close open file on member/snap/db 2017-10-20 15:25:21 -07:00
Gyu-Ho Lee
e80b2474fa etcdctl/ctlv3: inherit/update flags only once in 'check' command
When creating multiple clients, 'mustClientFromCmd' overwrites
inherited flags with environment variables, so later clients
were printing warnings on duplicate key updates.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-11 10:37:15 -07:00
Gyu-Ho Lee
d44f7d5f67 etcdctl/ctlv3: enable 'require-leader' for 'watch' command
To help with network partition cases.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-09 13:19:30 -07:00
yuleixiao
04940efcc2 etcdctl: add keep alive time/timeout in etcdctl
client can switch from fault node to normal when keep alive is timeout

Fixes #7941
2017-10-09 09:51:43 +08:00
Gyu-Ho Lee
0199bdc266 *: fix 'ineffassign' issues
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-03 10:14:33 -07:00
Gyu-Ho Lee
c63d6b6a25 ctlv3: print envs, configure grpc logger with debug flag
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-09-26 07:05:10 +09:00
Hitoshi Mitake
1ae6f1614d etcdctl: handle empty key permission correctly
Current `etcdctl role grant-permission` doesn't handle an empty key
("") correctly. Because the range permissions are treated as
BytesAffineInterval internally, just specifying the empty key as a
beginning of range introduces an invalid permission which doesn't work
and betray users' intuition. This commit fix the way of handling empty
key as a prefix or from key in permission granting.

Fix https://github.com/coreos/etcd/issues/8494
2017-09-13 14:25:52 +09:00
Gyu-Ho Lee
3b3d392540 *: use grpclog.LoggerV2
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-09-08 15:26:16 -07:00
Gyu-Ho Lee
f65aee0759 *: replace 'golang.org/x/net/context' with 'context'
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-09-07 13:39:42 -07:00
Anthony Romano
9a84c84ea6 Merge pull request #8479 from heyitsanthony/ctlv2-backup-v3
ctlv2: backup --with-v3
2017-09-05 13:46:29 -07:00
jiaxuanzhou
9a0f8c5917 etcdctl: add discovery-srv global flag for v3 2017-09-02 10:24:36 +08:00
Anthony Romano
9f7375c225 ctlv2: save v3 db with v2 data using --with-v3
Also strips out v3 data if not given --with-v3.
2017-08-31 22:57:41 -07:00
Anthony Romano
525fbba1bd etcdctl3: update to use RequestV2 instead of Request 2017-08-31 11:47:40 -07:00
Anthony Romano
1dea4c688e etcdctl: unset ETCDCTL_ARGS on cov builds
The stricter warnings on pkg/flags generates extra output that
break coverage tests. Unset the ETCDCTL_ARGS environment variable
so the warnings aren't printed.
2017-08-25 22:43:14 -07:00
Anthony Romano
6fd37dd9a3 etcdctl: document getting all keys with etcdctl3
People keep asking
2017-08-18 09:49:55 -07:00
Gyu-Ho Lee
1f20d5d924 etcdctl/ctlv3: add 'lease list' command
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-08-14 14:18:57 -07:00
Anthony Romano
04413454ac Merge pull request #8370 from jiaxuanzhou/lock_cmd
etcdctl: add ttl flag for lock command
2017-08-09 10:04:32 -07:00
Zhou
9c21eefd09 etcdctl: add ttl flag for lock command 2017-08-09 22:04:43 +08:00
Joe Betz
39432ac31f etcdctlv3: Add option to defrag a data directory directly, for cases where etcd is not running. 2017-08-08 10:19:32 -07:00
Gyu-Ho Lee
5176b63fa0 ctlv3: add 'endpoint hashkv' command
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-08-05 18:17:06 -07:00
Gyu-Ho Lee
9040b3eb2b ctlv3/command: remove double-quote typos in fields printer
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-08-01 17:21:15 -07:00