[VOL-5359] Add redis option as KVStore
Change-Id: I84ab0631e7fb53313a2ce3b451170eead949a068
Signed-off-by: Abhay Kumar <abhayk@radisys.com>
diff --git a/VERSION b/VERSION
index 21d6c27..57b6b97 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.0.1-dev1
+0.0.1-dev2
diff --git a/database/database.go b/database/database.go
index 5be86b5..0178a07 100644
--- a/database/database.go
+++ b/database/database.go
@@ -62,6 +62,9 @@
case "redis":
database.kvc, err = kvstore.NewRedisClient(address, time.Duration(timeout), false)
return &database, err
+ case "redis-sentinel":
+ database.kvc, err = kvstore.NewRedisClient(address, time.Duration(timeout), true)
+ return &database, err
case "etcd":
database.kvc, err = kvstore.NewEtcdClient(ctx, address, time.Duration(timeout), log.ErrorLevel)
return &database, err
diff --git a/voltha-go-controller/main.go b/voltha-go-controller/main.go
index 1b8d3e3..5f06351 100644
--- a/voltha-go-controller/main.go
+++ b/voltha-go-controller/main.go
@@ -76,10 +76,12 @@
func newKVClient(ctx context.Context, storeType, address string, timeout int) (kvstore.Client, error) {
logger.Infow(ctx, "kv-store-type", log.Fields{"store": storeType})
switch storeType {
- case "redis":
- return kvstore.NewRedisClient(address, time.Duration(timeout), false)
case "etcd":
return kvstore.NewEtcdClient(ctx, address, time.Duration(timeout), log.ErrorLevel)
+ case "redis":
+ return kvstore.NewRedisClient(address, time.Duration(timeout), false)
+ case "redis-sentinel":
+ return kvstore.NewRedisClient(address, time.Duration(timeout), true)
}
return nil, errors.New("unsupported-kv-store")
}