[VOL-3624] Parametrizing the KV-Store path
Change-Id: I44d8d72e12f83ee6c79020dd98ace4d2f1155def
diff --git a/cmd/openolt-adapter/main.go b/cmd/openolt-adapter/main.go
index 7f0c182..86e9549 100644
--- a/cmd/openolt-adapter/main.go
+++ b/cmd/openolt-adapter/main.go
@@ -98,6 +98,7 @@
// Setup Log Config
cm := conf.NewConfigManager(ctx, a.kvClient, a.config.KVStoreType, a.config.KVStoreAddress, a.config.KVStoreTimeout)
+
go conf.StartLogLevelConfigProcessing(cm, ctx)
go conf.StartLogFeaturesConfigProcessing(cm, ctx)
@@ -127,7 +128,7 @@
a.eventProxy = com.NewEventProxy(com.MsgClient(a.kafkaClient), com.MsgTopic(kafka.Topic{Name: a.config.EventTopic}))
// Create the open OLT adapter
- if a.iAdapter, err = a.startOpenOLT(ctx, a.kip, a.coreProxy, a.adapterProxy, a.eventProxy, a.config); err != nil {
+ if a.iAdapter, err = a.startOpenOLT(ctx, a.kip, a.coreProxy, a.adapterProxy, a.eventProxy, a.config, cm); err != nil {
logger.Fatalw(ctx, "error-starting-openolt", log.Fields{"error": err})
}
@@ -345,10 +346,10 @@
func (a *adapter) startOpenOLT(ctx context.Context, kip kafka.InterContainerProxy,
cp adapterif.CoreProxy, ap adapterif.AdapterProxy, ep adapterif.EventProxy,
- cfg *config.AdapterFlags) (*ac.OpenOLT, error) {
+ cfg *config.AdapterFlags, cm *conf.ConfigManager) (*ac.OpenOLT, error) {
logger.Info(ctx, "starting-open-olt")
var err error
- sOLT := ac.NewOpenOLT(ctx, a.kip, cp, ap, ep, cfg)
+ sOLT := ac.NewOpenOLT(ctx, a.kip, cp, ap, ep, cfg, cm)
if err = sOLT.Start(ctx); err != nil {
return nil, err
diff --git a/cmd/openolt-adapter/main_test.go b/cmd/openolt-adapter/main_test.go
index 6b6ea7e..3f029b6 100644
--- a/cmd/openolt-adapter/main_test.go
+++ b/cmd/openolt-adapter/main_test.go
@@ -18,6 +18,7 @@
import (
"context"
"errors"
+ conf "github.com/opencord/voltha-lib-go/v4/pkg/config"
"testing"
"time"
@@ -104,12 +105,13 @@
func Test_startOpenOLT(t *testing.T) {
a, _ := mockserver.StartMockServers(1)
+ cm := &conf.ConfigManager{}
_ = a.StartAt(0)
defer a.StopAt(0)
ad := newMockAdapter()
oolt, err := ad.startOpenOLT(context.TODO(), nil,
- ad.coreProxy, ad.adapterProxy, ad.eventProxy, ad.config)
+ ad.coreProxy, ad.adapterProxy, ad.eventProxy, ad.config, cm)
if oolt != nil {
t.Log("Open OLT ", oolt)
}
@@ -151,6 +153,7 @@
func Test_adapter_setupRequestHandler(t *testing.T) {
ad := newMockAdapter()
+ cm := &conf.ConfigManager{}
kip := kafka.NewInterContainerProxy(
kafka.InterContainerAddress(ad.config.KafkaAdapterAddress),
@@ -161,7 +164,7 @@
_ = ad.kip.Start(context.Background())
oolt, _ := ad.startOpenOLT(context.TODO(), nil,
- ad.coreProxy, ad.adapterProxy, ad.eventProxy, ad.config)
+ ad.coreProxy, ad.adapterProxy, ad.eventProxy, ad.config, cm)
printBanner()
printVersion()
ctx := context.TODO()