Pods pods = podsCache.get(instanceIdentifier).get();
if (pods != null) {
IpAddress podIpAddress = pods.getInterface().get(0).getIpAddress();
+ String clusterId = pods.getClusterId().getValue();
+ String elanInstanceName = CoeUtils.buildElanInstanceName(
+ pods.getHostIpAddress().stringValue(), clusterId);
coeUtils.updateElanInterfaceWithStaticMac(macAddress, podIpAddress,
- interfaceName, tx);
+ interfaceName, elanInstanceName, tx);
if (!isServiceGateway) {
- coeUtils.createVpnInterface(pods.getClusterId().getValue(), pods, interfaceName,
+ coeUtils.createVpnInterface(clusterId, pods, interfaceName,
macAddress,false, tx);
LOG.debug("Bind Kube Proxy Service for {}", interfaceName);
bindKubeProxyService(tx, interfaceName);
}
public void updateElanInterfaceWithStaticMac(String macAddress, IpAddress ipAddress,
- String elanInterfaceName,
- TypedReadWriteTransaction<Datastore.Configuration>
- wrtConfigTxn) {
+ String elanInterfaceName, String elanInstanceName,
+ TypedReadWriteTransaction<Datastore.Configuration> wrtConfigTxn) {
InstanceIdentifier<ElanInterface> id = InstanceIdentifier.builder(ElanInterfaces.class).child(ElanInterface
.class, new ElanInterfaceKey(elanInterfaceName)).build();
PhysAddress physAddress = PhysAddress.getDefaultInstance(macAddress);
physAddress)).setMacAddress(physAddress).setIpPrefix(ipAddress).build();
staticMacEntriesList.add(staticMacEntries);
ElanInterface elanInterface = new ElanInterfaceBuilder().setName(elanInterfaceName)
- .withKey(new ElanInterfaceKey(elanInterfaceName)).setStaticMacEntries(staticMacEntriesList).build();
+ .setElanInstanceName(elanInstanceName).withKey(
+ new ElanInterfaceKey(elanInterfaceName)).setStaticMacEntries(staticMacEntriesList).build();
wrtConfigTxn.merge(id, elanInterface);
LOG.debug("Updating ELAN Interface with static mac {}", elanInterface);
}