Skip to content

Commit

Permalink
Merge pull request #8672 from gyuho/require-leader
Browse files Browse the repository at this point in the history
etcdctl/ctlv3: enable 'require-leader' for 'watch' command
  • Loading branch information
gyuho authored Oct 9, 2017
2 parents ed92420 + d44f7d5 commit e47be1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion etcdctl/ctlv3/command/watch_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e47be1f

Please sign in to comment.