etcd-runner: update election command to use new Leader() interface

This commit is contained in:
Anthony Romano 2017-04-03 13:47:07 -07:00
parent 78422eaa17
commit 5f366db7d1

View File

@ -94,7 +94,7 @@ func runElectionFunc(cmd *cobra.Command, args []string) {
}
}
rcs[i].validate = func() error {
if l, err := e.Leader(context.TODO()); err == nil && l != observedLeader {
if l, err := e.Leader(context.TODO()); err == nil && string(l.Kvs[0].Value) != observedLeader {
return fmt.Errorf("expected leader %q, got %q", observedLeader, l)
}
validatec <- struct{}{}