@Override public OpenShiftRuntime getValue() { OpenShiftProvider providerId = createOpenShiftProvider(); OpenShiftRuntimeConfig runtimeConfig = new ContextAwareOpenShiftRuntimeExecConfig( RUNTIME_NAME, providerId, APPLICATION_NAME, KIE_SERVER_CONTAINER_DEPLOYMENT, PROJECT_NAME, RESOURCE_SECRETS_URI, RESOURCE_STREAMS_URI, RESOURCE_TEMPLATE_NAME, RESOURCE_TEMPLATE_PARAM_DELIMITER, RESOURCE_TEMPLATE_PARAM_ASSIGNER, RESOURCE_TEMPLATE_PARAM_VALUES, RESOURCE_TEMPLATE_URI, SERVICE_NAME); return new OpenShiftRuntime(RUNTIME_ID, RUNTIME_NAME, runtimeConfig, providerId, new OpenShiftRuntimeEndpoint(PROTOCOL, HOST, PORT, CONTEXT), new OpenShiftRuntimeInfo(runtimeConfig), new OpenShiftRuntimeState(STATE, STARTED_AT)); } }
@Override public OpenShiftRuntime getValue() { OpenShiftProvider providerId = createOpenShiftProvider(); OpenShiftRuntimeConfig runtimeConfig = new ContextAwareOpenShiftRuntimeExecConfig( RUNTIME_NAME, providerId, APPLICATION_NAME, KIE_SERVER_CONTAINER_DEPLOYMENT, PROJECT_NAME, RESOURCE_SECRETS_URI, RESOURCE_STREAMS_URI, RESOURCE_TEMPLATE_NAME, RESOURCE_TEMPLATE_PARAM_DELIMITER, RESOURCE_TEMPLATE_PARAM_ASSIGNER, RESOURCE_TEMPLATE_PARAM_VALUES, RESOURCE_TEMPLATE_URI, SERVICE_NAME); return new OpenShiftRuntime(RUNTIME_ID, RUNTIME_NAME, runtimeConfig, providerId, new OpenShiftRuntimeEndpoint(PROTOCOL, HOST, PORT, CONTEXT), new OpenShiftRuntimeInfo(runtimeConfig), new OpenShiftRuntimeState(STATE, STARTED_AT)); } }
public OpenShiftRuntimeEndpoint getRuntimeEndpoint(String id) throws OpenShiftClientException { try { OpenShiftRuntimeId runtimeId = OpenShiftRuntimeId.fromString(id); String prjName = runtimeId.project(); String svcName = runtimeId.service(); OpenShiftRuntimeEndpoint endpoint = new OpenShiftRuntimeEndpoint(); Route route = delegate.routes().inNamespace(prjName).withName(svcName).get(); if (route != null) { RouteSpec routeSpec = route.getSpec(); endpoint.setProtocol(routeSpec.getTls() != null ? "https" : "http"); endpoint.setHost(routeSpec.getHost()); RoutePort routePort = routeSpec.getPort(); if (routePort != null) { IntOrString targetPort = routePort.getTargetPort(); if (targetPort != null) { endpoint.setPort(targetPort.getIntVal()); } } } return endpoint; } catch (Throwable t) { throw new OpenShiftClientException(t.getMessage(), t); } }