Search in sources :

Example 1 with ITargetPort

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;
}
Also used : IServicePort(com.openshift.restclient.model.IServicePort) ITargetPort(com.openshift.restclient.model.route.ITargetPort) IRoute(com.openshift.restclient.model.route.IRoute)

Aggregations

IServicePort (com.openshift.restclient.model.IServicePort)1 IRoute (com.openshift.restclient.model.route.IRoute)1 ITargetPort (com.openshift.restclient.model.route.ITargetPort)1