Fix for timestamps not coming in kafka message
Change-Id: Ic43f46c935febe46d5e9b3ea70f006fa8012f4c6
diff --git a/vendor/github.com/opencord/voltha-lib-go/v4/pkg/db/kvstore/etcdclient.go b/vendor/github.com/opencord/voltha-lib-go/v4/pkg/db/kvstore/etcdclient.go
index 868b301..98f0559 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v4/pkg/db/kvstore/etcdclient.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v4/pkg/db/kvstore/etcdclient.go
@@ -24,6 +24,7 @@
"github.com/opencord/voltha-lib-go/v4/pkg/log"
v3Client "go.etcd.io/etcd/clientv3"
+
v3Concurrency "go.etcd.io/etcd/clientv3/concurrency"
v3rpcTypes "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes"
)
@@ -39,15 +40,10 @@
lockToMutexLock sync.Mutex
}
-// NewEtcdClient returns a new client for the Etcd KV store
-func NewEtcdClient(ctx context.Context, addr string, timeout time.Duration, level log.LogLevel) (*EtcdClient, error) {
- logconfig := log.ConstructZapConfig(log.JSON, level, log.Fields{})
-
- c, err := v3Client.New(v3Client.Config{
- Endpoints: []string{addr},
- DialTimeout: timeout,
- LogConfig: &logconfig,
- })
+// NewEtcdCustomClient returns a new client for the Etcd KV store allowing
+// the called to specify etcd client configuration
+func NewEtcdCustomClient(ctx context.Context, config *v3Client.Config) (*EtcdClient, error) {
+ c, err := v3Client.New(*config)
if err != nil {
logger.Error(ctx, err)
return nil, err
@@ -61,6 +57,18 @@
lockToSessionMap: lockSessionMap}, nil
}
+// NewEtcdClient returns a new client for the Etcd KV store
+func NewEtcdClient(ctx context.Context, addr string, timeout time.Duration, level log.LogLevel) (*EtcdClient, error) {
+ logconfig := log.ConstructZapConfig(log.JSON, level, log.Fields{})
+
+ return NewEtcdCustomClient(
+ ctx,
+ &v3Client.Config{
+ Endpoints: []string{addr},
+ DialTimeout: timeout,
+ LogConfig: &logconfig})
+}
+
// IsConnectionUp returns whether the connection to the Etcd KV store is up. If a timeout occurs then
// it is assumed the connection is down or unreachable.
func (c *EtcdClient) IsConnectionUp(ctx context.Context) bool {