Commit Graph

302 Commits (5c726cfe255a2ea50c2a1c8e5d0f893e60eb451a)

Author SHA1 Message Date
Gyuho Lee 9149565cb3 *: move to "etcdserver/api/membership"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-21 10:31:16 -07:00
Gyuho Lee 4d80753804 etcdctl: rename internal snapshot packages
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-21 07:45:34 -07:00
Hitoshi Mitake 8fcab98bf2 etcdctl: add flags for specifying password
This commit adds two flags to etcdctl:
1. `--password` flag to etcdctl as a global option. It can be used for
specifying password for authentication required for the command
execution.
2. `--new-user-password` flag to `etcdctl user add`. It can be used
for specifying password of newly created user by the command.

The main motivation of the flags is allowing user to have : in its
name.

Fix https://github.com/coreos/etcd/issues/9691
2018-05-21 16:18:01 +09:00
Gyuho Lee 7a92bbfed2 etcdserver/*: move internal v2 packages
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-14 12:49:49 -07:00
Gyuho Lee 167c711467 etcdctl/ctlv3: fix fmt test warnings
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-09 15:39:44 -07:00
Sahdev P. Zala 8ba41d5191 etcdctl/check: create progress bar for datascale
Create a progress bar. The bar will show progress for a given workload.

Fixes #9328
2018-05-08 18:32:54 -04:00
Gyuho Lee 44cda79105 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 17:22:34 -07:00
Gyuho Lee 200401248a
Merge pull request #9665 from gyuho/unconvert
test: integrate github.com/mdempsky/unconvert
2018-05-01 09:52:44 -07:00
Gyuho Lee b44e43278a etcdctl/ctlv3: fix "unconvert" warnings
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-30 15:32:16 -07:00
Gyuho Lee 86cee93d6b etcdctl/ctlv3: remove "strings.Compare == 0"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-30 15:11:11 -07:00
Eric Chiang 55001977ed
etcdctl/ctlv3/command: don't print gRPC WARNING logs by default
Despite holding important information, these are too noisy.

See https://github.com/coreos/etcd/pull/9623
2018-04-25 15:26:54 -07:00
Eric Chiang 9ce295a812
etcdctl/ctlv3/command: enable gRPC WARNING logs by default 2018-04-24 16:19:02 -07:00
Gyuho Lee ae9ccd883d etcdctl/ctlv3: fix snapshot command e2e tests
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-16 17:36:00 -07:00
Gyuho Lee 6dbce6b9a4 clientv3,etcdctl: support structured logger
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-16 17:36:00 -07:00
Gyuho Lee 90e5af76f3 etcdctl/ctlv3: use new snapshot package
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-12 10:49:48 -07:00
Gyuho Lee ff455e3567
Merge pull request #9540 from gyuho/hhh
ctlv3: support "write-out" for "endpoint health" command
2018-04-06 13:25:11 -07:00
Gyuho Lee d019d3141a ctlv3: support "write-out" for "endpoint health" command
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-06 11:31:00 -07:00
Gyuho Lee 18b1d1ff65 ctlv3: update logger for snapshot command
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-06 11:05:58 -07:00
Gyuho Lee 021df6a827 etcdctl/ctlv3: set client-side logger
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-02 13:51:22 -07:00
Gyuho Lee aece63b10e etcdctl: use "TrustedCAFile"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-03-20 15:31:32 -07:00
Gyuho Lee 4e0c00244d *: remove "pkg/logger", replace with "pkg/logutil"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-03-07 10:49:25 -08:00
Gyuho Lee 912c402188 etcdctl/ctlv3: add "--cluster" flag to "defrag" command
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-03-05 10:46:37 -08:00
Gyuho Lee 69f7e11506 *: move "error" to "etcdserver/v2error"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-26 17:11:40 -08:00
Gyuho Lee 8a518b01c4 *: revert "internal/mvcc" change
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-26 17:11:40 -08:00
Gyuho Lee 9b5d6edc4b *: revert "internal/raftsnap"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-26 17:11:40 -08:00
Gyuho Lee 0e12e888e0 *: move "internal/store" to "etcdserver/v2store"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-26 17:11:40 -08:00
Gyuho Lee 0850ccbf45 *: revert "internal/version" change
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-26 17:11:40 -08:00
Gyuho Lee bab0223f04 ctlv3: fix typo in check command
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-26 10:03:43 -08:00
Sahdev P. Zala fc30b9844a etcdctl/check: enable auto compact and defrag for check datascale
Running check datascale can create large history of keyspaces and
internal fragmentation. Allow user to run auto compact and defrag
when run check datascale.
2018-02-23 18:12:54 -05:00
Sahdev P. Zala 53d2a2edfe etcdctl/check: create new check command for memory usage
Create a new command similar to check perf that can check the memory
consumption for putting different workloads on a given endpoint. If no endpoint
is provided, localhost will be used. Return user with a message that whether
there are enough memory for a given workload with pass or fail.

Fixed #9121
2018-02-17 12:01:31 -05:00
Gyuho Lee d1e85570e9 ctlv3/command: auto compact and defrag after "check perf"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-15 14:28:02 -08:00
Gyuho Lee a2ce52d8c2 etcdctl/ctlv3: use "logger.NewPackageLogger"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-05 13:50:54 -08:00
Gyuho Lee 37546f74ab *: move "version" to "internal/version"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-29 10:00:20 -08:00
Gyuho Lee 80d15948bc *: move "mvcc" to "internal/mvcc"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-26 11:14:41 -08:00
Gyuho Lee 880835c02c *: move "store" to "internal/store"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-26 11:06:22 -08:00
Gyuho Lee 3fdaf4eaa7
Merge pull request #9206 from dvonthenen/feature/issue9163
Exposes alarm/health information in "etcdctl endpoint status"
2018-01-25 07:18:22 -08:00
Manjunath A Kumatagi fd20ba75dc etcdctl: Fix govet errors 2018-01-25 04:50:09 -05:00
dvonthenen db822ed38f *: add alarm/health information in endpoint status
Update to remove raftIndex and document the Alarms() interface

Fix formatting

Fix typo
2018-01-24 13:12:48 -08:00
Gyuho Lee dee39bf786 internal/raftsnap: move "raftsnap" to internal
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-24 10:36:04 -08:00
Gyuho Lee 2b6fd3094f *: rename "snap" to "raftsnap" package
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-24 10:26:07 -08:00
Gyuho Lee df689f4280 etcdctl/ctlv3: use "snapshot" package for "snapshot" command
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-22 16:46:15 -08:00
Gyuho Lee c3ba417737 etcdctl/ctlv3: replace "dbStatus" with "snapshot.Status"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-22 16:46:15 -08:00
dvonthenen 25cdf4ed92 *: expose Raft Applied Index through to "etcdctl endpoint status"
Fixed based on feedback

Fixed spacing

Fix gofmt
2018-01-22 07:37:21 -08:00
Gyuho Lee 5e0118d7ef ctlv3: set ETCD_WATCH_* on watch exec
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-17 09:54:16 -08:00
Gyuho Lee 2c347d7158 ctlv3: exit on exec watch error
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-16 09:04:46 -08:00
Gyuho Lee 72a2a6671e ctlv3: set ETCD_WATCH_KEY, ETCD_WATCH_VALUE on exec watch
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-16 09:03:10 -08:00
Gyuho Lee 388b7fece6 ctlv3: handle pkg/flags warnings
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-14 11:15:45 -08:00
Gyuho Lee 8183b83220 ctlv3: support ETCDCTL_WATCH_KEY, ETCDCTL_WATCH_RANGE_END
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-14 02:30:03 -08:00
Hitoshi Mitake b337674971 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 15:39:42 +09:00
Gyuho Lee 285a83d70a ctlv3: add "snapshot restore --wal-dir"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-09 09:25:26 -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 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 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
jiaxuanzhou 9a0f8c5917 etcdctl: add discovery-srv global flag for v3 2017-09-02 10:24:36 +08: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
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
Gyu-Ho Lee 073fa562d8 Merge pull request #8342 from gyuho/ep-exit
ctlv3: exit non-zero on unhealty ep command
2017-07-31 15:45:30 -07:00
Dima Kurguzov 6603a77561 ctlv3: exit non-zero on unhealty ep command 2017-07-31 14:17:01 -07:00
Anthony Romano 79660db61b etcdctl: add lease comparison to txn command 2017-07-31 13:00:04 -07:00
Gyu-Ho Lee 98fc5e5769 ctlv3: print 'ETCD_INITIAL_ADVERTISE_PEER_URLS' in 'member add'
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-07-28 13:53:13 -07:00
fanmin shi bb0e144b43 etcdctl: print "del" instead of "delete" in txn interactive mode 2017-07-21 14:31:39 -07:00
Anthony Romano 28b4dce4f1 etcdctl: remove extra space in error message
Fprintln will insert a space between arguments, so printing "Error: "
would lead to two spaces between the "Error:" and the error string.
2017-07-13 13:04:21 -07:00
Gyu-Ho Lee 2e7615281e Merge pull request #8210 from gyuho/bbolt
*: use 'coreos/bbolt' (replace 'boltdb/bolt')
2017-07-06 13:00:21 -07:00
Gyu-Ho Lee 318e9c766f *: replace 'boltdb' import paths with 'coreos/bbolt'
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-07-05 14:32:13 -07:00
Gyu-Ho Lee 6e9b776fce etcdctl/ctlv3: add 'move-leader' command
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-06-23 13:19:12 -07:00
Gyu-Ho Lee f2d8929a09 etcdctl/ctlv3: remove unnecessary 'return'
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-06-22 12:24:00 -07:00
Anthony Romano 1a2be432c5 etcdctl: --cluster flag using cluster endpoints for endpoint commands
Queries the cluster for endpoints to use for the endpoint commands.

Fixes #8117
2017-06-21 13:55:23 -07:00
Anthony Romano 887db5a3db *: fix go tool vet -all -shadow errors 2017-06-03 21:32:36 -07:00
Anthony Romano dac2c10ce9 etcdctl, e2e: use 0xe7cd as argument separator in cov-enabled etcdctl
Fixes #7980
2017-05-25 16:11:52 -07:00
Anthony Romano 643c2a310d etcdctl: support exec on lock
The lock command is clumsy to use from the command line, needing mkfifo,
wait, etc. Instead, make like consul and support launching a command if
one is given.
2017-05-24 16:47:00 -07:00
Anthony Romano f75e333264 Merge pull request #7958 from heyitsanthony/perm-prefix
etcdctl: improve role --prefix flag
2017-05-22 12:19:16 -07:00
Hitoshi Mitake 939912c425 clientv3, etcdserver: support auth in Watch() 2017-05-20 11:34:45 +09:00
Anthony Romano bd680c3302 ctlv3: add --prefix support to role revoke-permission, cleanup role flag handling 2017-05-19 13:53:46 -07:00
Gyu-Ho Lee e15020055e *: remove unnecessary fmt.Sprint
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-05-15 13:23:31 -07:00
Anthony Romano 6dd8fb6f24 Revert "Merge pull request #7732 from heyitsanthony/lease-err-ka"
This reverts commit fbbc4a4979, reversing
changes made to f254e38385.

Fixes #7851
2017-05-02 09:36:16 -07:00
Anthony Romano 70f0bbe38c etcdcdtl: use new lease interface 2017-04-24 23:49:44 -07:00
Anthony Romano cf8c66c9f0 ctlv3: use printer for lease command results
Fixes #7783
2017-04-20 09:41:04 -07:00
Anthony Romano fcd4871e2a ctlv3: keep lease as integer in fields printer
Output was giving %!d(string=) instead of the expected lease ID
value.
2017-04-19 00:48:13 -07:00
Hitoshi Mitake 8efc42e25f etcdctl: show responses of auth RPCs if --write-output=fields is passed 2017-04-14 11:48:42 +09:00
Gyu-Ho Lee 7fb1f68ff8 *: coreos/rkt -> rkt/rkt
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-11 08:48:48 -07:00