mirror of
https://github.com/opennetworkinglab/onos.git
synced 2026-05-10 14:46:10 +02:00
Fix: wait for creation of patch ports which are on tenant bridges
Resolve a NPE issue caused when missing name attribute in status object in VirtualMachineInstance Change-Id: I1315a63bbaae250abcc4ed6cec92fb1ed160dfd8 (cherry picked from commit dd4041e154a2850d48ed44800a7189cd04df0e6d)
This commit is contained in:
parent
f3a3c5acd2
commit
56f241be23
@ -297,6 +297,19 @@ public class KubevirtSecurityGroupHandler {
|
||||
|
||||
private void initializeTenantAclTable(KubevirtNetwork network,
|
||||
DeviceId deviceId, boolean install) {
|
||||
// FIXME: in bridge initialization phase, some patch ports may not be
|
||||
// available until they are created, we wait for a while ensure all
|
||||
// patch ports are created via network bootstrap
|
||||
while (true) {
|
||||
if (network.tenantToTunnelPort(deviceId) != null) {
|
||||
break;
|
||||
} else {
|
||||
log.info("Wait for tenant patch ports creation for device {} " +
|
||||
"and network {}", deviceId, network.networkId());
|
||||
waitFor(5);
|
||||
}
|
||||
}
|
||||
|
||||
PortNumber patchPort = network.tenantToTunnelPort(deviceId);
|
||||
initializeAclTable(deviceId, TENANT_ACL_RECIRC_TABLE, patchPort, install);
|
||||
}
|
||||
|
||||
@ -357,7 +357,15 @@ public final class KubevirtNetworkingUtil {
|
||||
|
||||
Set<KubevirtPort> ports = new HashSet<>();
|
||||
for (JsonNode interfaceJson : interfacesJson) {
|
||||
String name = interfaceJson.get(NAME).asText();
|
||||
JsonNode jsonName = interfaceJson.get(NAME);
|
||||
|
||||
// in some cases, name attribute may not be available from the
|
||||
// interface, we skip inspect this interface
|
||||
if (jsonName == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String name = jsonName.asText();
|
||||
KubevirtNetwork network = networks.stream()
|
||||
.filter(n -> (NETWORK_PREFIX + n.name()).equals(name) ||
|
||||
(n.name() + "-net").equals(name))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user