Skip to content

Commit e47be1f

Browse files
authored
Merge pull request #8672 from gyuho/require-leader
etcdctl/ctlv3: enable 'require-leader' for 'watch' command
2 parents ed92420 + d44f7d5 commit e47be1f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

etcdctl/ctlv3/command/watch_command.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func getWatchChan(c *clientv3.Client, args []string) (clientv3.WatchChan, error)
125125
if watchPrevKey {
126126
opts = append(opts, clientv3.WithPrevKV())
127127
}
128-
return c.Watch(context.TODO(), key, opts...), nil
128+
return c.Watch(clientv3.WithRequireLeader(context.Background()), key, opts...), nil
129129
}
130130

131131
func printWatchCh(ch clientv3.WatchChan) {

0 commit comments

Comments
 (0)