use of org.onosproject.kubevirtnode.api.Constants.TENANT_BRIDGE_PREFIX in project onos by opennetworkinglab.
the class DefaultKubevirtNodeHandler method cleanPhysicalInterfaces.
private void cleanPhysicalInterfaces(KubevirtNode node) {
Device device = deviceService.getDevice(node.ovsdb());
BridgeConfig bridgeConfig = device.as(BridgeConfig.class);
Set<String> bridgeNames = bridgeConfig.getBridges().stream().map(BridgeDescription::name).collect(Collectors.toSet());
Set<String> phyNetworkNames = node.phyIntfs().stream().map(pi -> BRIDGE_PREFIX + pi.network()).collect(Collectors.toSet());
// bridges are not defined in kubevirt node
for (String brName : bridgeNames) {
// physical bridges
if (brName.equals(INTEGRATION_BRIDGE) || brName.equals(TUNNEL_BRIDGE) || brName.startsWith(TENANT_BRIDGE_PREFIX)) {
continue;
}
if (!phyNetworkNames.contains(brName)) {
removePhysicalPatchPorts(node, brName.substring(NETWORK_BEGIN));
removePhysicalBridge(node, brName.substring(NETWORK_BEGIN));
log.info("Removing physical bridge {}...", brName);
}
}
}
Aggregations