L3 handling for COE services.
[netvirt.git] / coe / impl / src / main / java / org / opendaylight / netvirt / coe / listeners / TerminationPointStateListener.java
index 3195634516db0091606e7be8498134f5345f48ef..f48629d95b9dc606830362031a507940d0471f7d 100644 (file)
@@ -109,11 +109,15 @@ public class TerminationPointStateListener extends
                                             pods.getHostIpAddress().stringValue(), clusterId);
                                     coeUtils.updateElanInterfaceWithStaticMac(macAddress, podIpAddress,
                                             interfaceName, elanInstanceName, tx);
-                                    if (!isServiceGateway) {
-                                        coeUtils.createVpnInterface(clusterId, pods, interfaceName,
-                                                macAddress,false, tx);
-                                        LOG.debug("Bind Kube Proxy Service for {}", interfaceName);
-                                        bindKubeProxyService(tx, interfaceName);
+                                    coeUtils.createVpnInterface(pods.getClusterId().getValue(), pods, interfaceName,
+                                            macAddress,false, tx);
+                                    LOG.debug("Bind Kube Proxy Service for {}", interfaceName);
+                                    bindKubeProxyService(tx, interfaceName);
+                                    if (isServiceGateway) {
+                                        String ipValue = podIpAddress.getIpv4Address() != null
+                                                ? podIpAddress.getIpv4Address().getValue() :
+                                                podIpAddress.getIpv6Address().getValue();
+                                        coeUtils.updateServiceGatewayList(tx, interfaceName, ipValue, macAddress);
                                     }
                                 }
                             }), LOG, "Error handling pod configuration for termination-point");