Merge pull request #8672 from gyuho/require-leader

etcdctl/ctlv3: enable 'require-leader' for 'watch' command
release-3.3
Gyu-Ho Lee 2017-10-09 13:38:52 -07:00 committed by GitHub
commit e47be1f325
1 changed files with 1 additions and 1 deletions

View File

@ -125,7 +125,7 @@ func getWatchChan(c *clientv3.Client, args []string) (clientv3.WatchChan, error)
if watchPrevKey {
opts = append(opts, clientv3.WithPrevKV())
}
return c.Watch(context.TODO(), key, opts...), nil
return c.Watch(clientv3.WithRequireLeader(context.Background()), key, opts...), nil
}
func printWatchCh(ch clientv3.WatchChan) {