use of org.onosproject.k8snode.api.K8sBridge in project onos by opennetworkinglab.
the class DefaultK8sHostHandler method createBridge.
private void createBridge(DeviceId ovsdb, K8sBridge bridge) {
Device device = deviceService.getDevice(ovsdb);
List<ControllerInfo> controllers = clusterService.getNodes().stream().map(n -> new ControllerInfo(n.ip(), DEFAULT_OFPORT, DEFAULT_OF_PROTO)).collect(Collectors.toList());
String dpid = bridge.dpid().substring(DPID_BEGIN);
BridgeDescription.Builder builder = DefaultBridgeDescription.builder().name(bridge.name()).failMode(BridgeDescription.FailMode.SECURE).datapathId(dpid).disableInBand().controllers(controllers);
BridgeConfig bridgeConfig = device.as(BridgeConfig.class);
bridgeConfig.addBridge(builder.build());
}
Aggregations