mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdctl: fix watch -after-index parsing
It uses -after-index incorrectly now: ``` $ ./bin/etcdctl --debug watch -after-index 31 foo Cluster-Endpoints: http://localhost:2379, http://localhost:4001 cURL Command: curl -X GET http://localhost:2379/v2/keys/foo?recursive=false&wait=true&waitIndex=33 ``` After this PR: ``` $ ./bin/etcdctl --debug watch -after-index 31 foo Cluster-Endpoints: http://localhost:2379, http://localhost:4001 cURL Command: curl -X GET http://localhost:2379/v2/keys/foo?recursive=false&wait=true&waitIndex=32 ```
This commit is contained in:
parent
219ed1695b
commit
147885078c
@ -49,10 +49,7 @@ func watchCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
||||
key := c.Args()[0]
|
||||
recursive := c.Bool("recursive")
|
||||
forever := c.Bool("forever")
|
||||
index := 0
|
||||
if c.Int("after-index") != 0 {
|
||||
index = c.Int("after-index") + 1
|
||||
}
|
||||
index := c.Int("after-index")
|
||||
|
||||
stop := false
|
||||
w := ki.Watcher(key, &client.WatcherOptions{AfterIndex: uint64(index), Recursive: recursive})
|
||||
|
Loading…
x
Reference in New Issue
Block a user