private void validateRoutesMatchServices(OpenShiftEnvironment env) throws ValidationException { Set<String> recipeServices = env.getServices() .values() .stream() .map(s -> s.getMetadata().getName()) .collect(Collectors.toSet()); for (Route route : env.getRoutes().values()) { if (route.getSpec() == null || route.getSpec().getTo() == null || !route.getSpec().getTo().getKind().equals(SERVICE_KIND)) { continue; } String serviceName = route.getSpec().getTo().getName(); if (!recipeServices.contains(serviceName)) { throw new ValidationException( String.format( "Route '%s' refers to Service '%s'. Routes must refer to Services included in recipe", route.getMetadata().getName(), serviceName)); } } } }
private Route updateRoute(Route route, Service service) { route.getSpec().getTo().setName(service.getMetadata().getName()); return route; }
private Route updateRoute(Route route, Service service) { route.getSpec().getTo().setName(service.getMetadata().getName()); return route; }
public RouteSpecBuilder( RouteSpecFluent<?> fluent , RouteSpec instance ){ this.fluent = fluent; fluent.withHost(instance.getHost()); fluent.withPath(instance.getPath()); fluent.withTls(instance.getTls()); fluent.withTo(instance.getTo()); } public RouteSpecBuilder( RouteSpec instance ){
public RouteSpecBuilder( RouteSpec instance ){ this.fluent = this; this.withHost(instance.getHost()); this.withPath(instance.getPath()); this.withTls(instance.getTls()); this.withTo(instance.getTo()); }
public RouteSpecBuilder( RouteSpec instance ){ this.fluent = this; this.withHost(instance.getHost()); this.withPath(instance.getPath()); this.withTls(instance.getTls()); this.withTo(instance.getTo()); }
public RouteSpecBuilder( RouteSpecFluent<?> fluent , RouteSpec instance ){ this.fluent = fluent; fluent.withHost(instance.getHost()); fluent.withPath(instance.getPath()); fluent.withTls(instance.getTls()); fluent.withTo(instance.getTo()); } public RouteSpecBuilder( RouteSpec instance ){
public RouteSpecBuilder(RouteSpecFluent<?> fluent,RouteSpec instance,Boolean validationEnabled){ this.fluent = fluent; fluent.withAlternateBackends(instance.getAlternateBackends()); fluent.withHost(instance.getHost()); fluent.withPath(instance.getPath()); fluent.withPort(instance.getPort()); fluent.withTls(instance.getTls()); fluent.withTo(instance.getTo()); this.validationEnabled = validationEnabled; } public RouteSpecBuilder(RouteSpec instance){
public RouteSpecFluentImpl(RouteSpec instance){ this.withAlternateBackends(instance.getAlternateBackends()); this.withHost(instance.getHost()); this.withPath(instance.getPath()); this.withPort(instance.getPort()); this.withTls(instance.getTls()); this.withTo(instance.getTo()); }
public RouteSpecBuilder(RouteSpec instance,Boolean validationEnabled){ this.fluent = this; this.withAlternateBackends(instance.getAlternateBackends()); this.withHost(instance.getHost()); this.withPath(instance.getPath()); this.withPort(instance.getPort()); this.withTls(instance.getTls()); this.withTo(instance.getTo()); this.validationEnabled = validationEnabled; }