diff --git a/apps/kubevirt-networking/app/src/main/java/org/onosproject/kubevirtnetworking/util/KubevirtNetworkingUtil.java b/apps/kubevirt-networking/app/src/main/java/org/onosproject/kubevirtnetworking/util/KubevirtNetworkingUtil.java index 4ee8fa23b0d..a6ac2299ba2 100644 --- a/apps/kubevirt-networking/app/src/main/java/org/onosproject/kubevirtnetworking/util/KubevirtNetworkingUtil.java +++ b/apps/kubevirt-networking/app/src/main/java/org/onosproject/kubevirtnetworking/util/KubevirtNetworkingUtil.java @@ -42,7 +42,6 @@ import org.onosproject.kubevirtnode.api.KubevirtApiConfigService; import org.onosproject.kubevirtnode.api.KubevirtNode; import org.onosproject.kubevirtnode.api.KubevirtNodeService; -import org.onosproject.kubevirtnode.api.KubevirtPhyInterface; import org.onosproject.net.DeviceId; import org.onosproject.net.Port; import org.onosproject.net.PortNumber; @@ -547,13 +546,13 @@ public static KubevirtRouter getRouterForKubevirtNetwork(KubevirtRouterService r * @return external patch port number */ public static PortNumber externalPatchPortNum(DeviceService deviceService, KubevirtNode gatewayNode) { - KubevirtPhyInterface intf = gatewayNode.phyIntfs().stream().findFirst().orElse(null); - if (intf == null) { + String gatewayBridgeName = gatewayNode.gatewayBridgeName(); + if (gatewayBridgeName == null) { log.warn("No external interface is attached to gateway {}", gatewayNode.hostname()); return null; } - String patchPortName = "int-to-" + intf.network(); + String patchPortName = "int-to-" + gatewayBridgeName; Port port = deviceService.getPorts(gatewayNode.intgBridge()).stream() .filter(p -> p.isEnabled() && Objects.equals(p.annotations().value(PORT_NAME), patchPortName))