12125: panic: zap.Logger is nil in Embed client

This commit is contained in:
Denis Issoupov
2020-07-13 09:05:06 -07:00
parent 07461ecc8c
commit 701f02f90a
3 changed files with 24 additions and 1 deletions

View File

@@ -29,6 +29,10 @@ import (
// to the etcd server through its api/v3rpc function interfaces.
func New(s *etcdserver.EtcdServer) *clientv3.Client {
c := clientv3.NewCtxClient(context.Background())
lg := s.Logger()
if lg != nil {
c.WithLogger(lg)
}
kvc := adapter.KvServerToKvClient(v3rpc.NewQuotaKVServer(s))
c.KV = clientv3.NewKVFromKVClient(kvc, c)