use of com.openshift.restclient.model.route.ITargetPort in project jbosstools-openshift by jbosstools.
the class DeployImageJob method stubRoute.
private IResource stubRoute(IResourceFactory factory, String name, String serviceName) {
IRoute route = factory.stub(ResourceKind.ROUTE, name, parameters.getProject().getName());
route.setServiceName(serviceName);
String hostname = parameters.getRouteHostname();
if (StringUtils.isNotBlank(hostname)) {
route.setHost(hostname);
}
IServicePort port = parameters.getRoutingPort();
if (port != null) {
ITargetPort targetPort = route.createPort();
if (port.getName() != null) {
targetPort.setTargetPortName(port.getName());
} else {
targetPort.setTargetPort(port.getPort());
}
}
return route;
}
Aggregations