Support connecting to multiple OpenFlow controllers
Change-Id: I0989d5031fb2d4f5aa78ba0e4576e465f826a419
diff --git a/internal/pkg/ofagent/refresh.go b/internal/pkg/ofagent/refresh.go
index d50b3ec..835e551 100644
--- a/internal/pkg/ofagent/refresh.go
+++ b/internal/pkg/ofagent/refresh.go
@@ -90,14 +90,14 @@
ofc := ofa.clientMap[deviceID]
if ofc == nil {
ofc = openflow.NewOFClient(&openflow.OFClient{
- DeviceID: deviceID,
- OFControllerEndPoint: ofa.OFControllerEndPoint,
- VolthaClient: ofa.volthaClient,
- PacketOutChannel: ofa.packetOutChannel,
- ConnectionMaxRetries: ofa.ConnectionMaxRetries,
- ConnectionRetryDelay: ofa.ConnectionRetryDelay,
+ DeviceID: deviceID,
+ OFControllerEndPoints: ofa.OFControllerEndPoints,
+ VolthaClient: ofa.volthaClient,
+ PacketOutChannel: ofa.packetOutChannel,
+ ConnectionMaxRetries: ofa.ConnectionMaxRetries,
+ ConnectionRetryDelay: ofa.ConnectionRetryDelay,
})
- go ofc.Run(context.Background())
+ ofc.Run(context.Background())
ofa.clientMap[deviceID] = ofc
}
ofa.mapLock.Unlock()