[VOL-5359] Add redis option as KVStore
Change-Id: I2bfb177e91e748cef3de94a525630cd53601484d
Signed-off-by: Abhay Kumar <abhayk@radisys.com>
diff --git a/VERSION b/VERSION
index ccc99d0..e61dbb0 100755
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.12.3
+2.12.3-dev1
diff --git a/cmd/openonu-adapter/main.go b/cmd/openonu-adapter/main.go
index 1d9dc3b..f0d8a76 100644
--- a/cmd/openonu-adapter/main.go
+++ b/cmd/openonu-adapter/main.go
@@ -237,6 +237,10 @@
switch storeType {
case "etcd":
return kvstore.NewEtcdClient(ctx, address, timeout, log.FatalLevel)
+ case "redis":
+ return kvstore.NewRedisClient(address, timeout, false)
+ case "redis-sentinel":
+ return kvstore.NewRedisClient(address, timeout, true)
}
return nil, errors.New("unsupported-kv-store")
}
diff --git a/internal/pkg/config/config.go b/internal/pkg/config/config.go
index 08ecfa3..1f29999 100644
--- a/internal/pkg/config/config.go
+++ b/internal/pkg/config/config.go
@@ -25,8 +25,8 @@
// Open ONU default constants
const (
- EtcdStoreName = "etcd"
- OnuVendorIds = "OPEN,ALCL,BRCM,TWSH,ALPH,ISKT,SFAA,BBSM,SCOM,ARPX,DACM,ERSN,HWTC,CIGG,ADTN,ARCA,AVMG,LEOX,ZYXE"
+ KVStoreName = "etcd"
+ OnuVendorIds = "OPEN,ALCL,BRCM,TWSH,ALPH,ISKT,SFAA,BBSM,SCOM,ARPX,DACM,ERSN,HWTC,CIGG,ADTN,ARCA,AVMG,LEOX,ZYXE"
)
// AdapterFlags represents the set of configurations used by the read-write adaptercore service
@@ -95,7 +95,7 @@
fs.StringVar(&(so.KVStoreType),
"kv_store_type",
- EtcdStoreName,
+ KVStoreName,
"KV store type")
fs.DurationVar(&(so.KVStoreTimeout),