[VOL-3707] Adding support for multiple onu-adapter and removing the OLT topic from configuration
Change-Id: Ic358a6d3c1b60a9a2bc2163a2ddb5e11c471fdd0
diff --git a/internal/pkg/config/config.go b/internal/pkg/config/config.go
index 6c2283d..75ff11d 100644
--- a/internal/pkg/config/config.go
+++ b/internal/pkg/config/config.go
@@ -41,7 +41,6 @@
defaultDisplayVersionOnly = false
defaultAccIncrEvto = false
defaultTopic = "openonu"
- defaultOltTopic = "openolt"
defaultCoreTopic = "rwcore"
defaultEventTopic = "voltha.events"
defaultOnunumber = 1
@@ -78,7 +77,6 @@
KVStoreHost string
KVStorePort int
Topic string
- OltTopic string
CoreTopic string
EventTopic string
LogLevel string
@@ -114,7 +112,6 @@
KVStoreHost: defaultKvstorehost,
KVStorePort: defaultKvstoreport,
Topic: defaultTopic,
- OltTopic: defaultOltTopic,
CoreTopic: defaultCoreTopic,
EventTopic: defaultEventTopic,
LogLevel: defaultLoglevel,
@@ -155,10 +152,7 @@
flag.IntVar(&(so.KafkaClusterPort), "kafka_cluster_port", defaultKafkaclusterport, help)
help = fmt.Sprintf("Open ONU topic")
- flag.StringVar(&(so.Topic), "adapter_topic", defaultTopic, help)
-
- help = fmt.Sprintf("Open OLT topic")
- flag.StringVar(&(so.OltTopic), "olt_adapter_topic", defaultOltTopic, help)
+ baseAdapterTopic := flag.String("adapter_topic", defaultTopic, help)
help = fmt.Sprintf("Core topic")
flag.StringVar(&(so.CoreTopic), "core_topic", defaultCoreTopic, help)
@@ -239,6 +233,8 @@
so.InstanceID = containerName
}
+ so.Topic = fmt.Sprintf("%s_%d", *baseAdapterTopic, int32(so.CurrentReplica))
+
}
func getContainerInfo() string {
diff --git a/internal/pkg/onuadaptercore/omci_vlan_config.go b/internal/pkg/onuadaptercore/omci_vlan_config.go
index 86316cc..21cdbda 100644
--- a/internal/pkg/onuadaptercore/omci_vlan_config.go
+++ b/internal/pkg/onuadaptercore/omci_vlan_config.go
@@ -2018,10 +2018,6 @@
//rowKey = 0
tableCtrlStr := "0100000000000000"
tableCtrl := AsByteSlice(tableCtrlStr)
- //TODO Building it as a Table, even though the attribute is `StringAttributeType`
- // see line 56 of multicastoperationsprofileframe.go, it's an error in the conversion.
- // FIXED 30/12/2020 Fixed for now with a local copy of multicastoperationsprofileframe.go in vendor/omci-lib-go
- // provided by Chip, needs upstreaming and version change.
dynamicAccessCL := make([]uint8, 24)
copy(dynamicAccessCL, tableCtrl)
//Multicast GemPortId