public static String getURLFromTLSHost(IngressRule rule, String pathPostFix) { String host = rule.getHost(); if (!host.isEmpty()) { pathPostFix = fixPathPostFixIfEmpty(pathPostFix); return "https://" + URLUtils.pathJoin(host, pathPostFix); } return null; }
public static String getURLFromIngressRules(List<HTTPIngressPath> paths, IngressSpec spec, String serviceName, ServicePort port, IngressRule rule) { for(HTTPIngressPath path : paths) { IngressBackend backend = path.getBackend(); if(backend != null) { String backendServiceName = backend.getServiceName(); if(serviceName.equals(backendServiceName) && portsMatch(port, backend.getServicePort())) { String pathPostFix = path.getPath(); if(spec.getTls() != null) { return getURLFromTLSHost(rule, pathPostFix); } String answer = rule.getHost(); if(answer != null && !answer.isEmpty()) { pathPostFix = fixPathPostFixIfEmpty(pathPostFix); return "http://" + URLUtils.pathJoin(answer, pathPostFix); } } } } return null; }
public IngressRuleBuilder(IngressRuleFluent<?> fluent,IngressRule instance,Boolean validationEnabled){ this.fluent = fluent; fluent.withHost(instance.getHost()); fluent.withHttp(instance.getHttp()); this.validationEnabled = validationEnabled; } public IngressRuleBuilder(IngressRule instance){
public IngressRuleBuilder(IngressRule instance,Boolean validationEnabled){ this.fluent = this; this.withHost(instance.getHost()); this.withHttp(instance.getHttp()); this.validationEnabled = validationEnabled; }
public IngressRuleFluentImpl(IngressRule instance){ this.withHost(instance.getHost()); this.withHttp(instance.getHttp()); }
answer = rule.getHost(); if (StringUtils.isNotBlank(answer)) { return String.format("http://%s/%s",answer, preparePath(pathPostfix));