Search in sources :

Example 1 with IngressRulePathConfig

use of org.eclipse.jkube.kit.config.resource.IngressRulePathConfig in project jkube by eclipse.

the class NetworkingV1IngressGenerator method getIngressRuleFromXmlConfig.

private static IngressRule getIngressRuleFromXmlConfig(IngressRuleConfig ingressRuleConfig) {
    IngressRuleBuilder ingressRuleBuilder = new IngressRuleBuilder();
    if (ingressRuleConfig.getHost() != null) {
        ingressRuleBuilder.withHost(ingressRuleConfig.getHost());
    }
    if (ingressRuleConfig.getPaths() != null && !ingressRuleConfig.getPaths().isEmpty()) {
        HTTPIngressRuleValueBuilder httpIngressPathBuilder = new HTTPIngressRuleValueBuilder();
        for (IngressRulePathConfig ingressRulePathConfig : ingressRuleConfig.getPaths()) {
            httpIngressPathBuilder.addToPaths(getHTTPIngressPath(ingressRulePathConfig));
        }
        ingressRuleBuilder.withHttp(httpIngressPathBuilder.build());
    }
    return ingressRuleBuilder.build();
}
Also used : IngressRuleBuilder(io.fabric8.kubernetes.api.model.networking.v1.IngressRuleBuilder) HTTPIngressRuleValueBuilder(io.fabric8.kubernetes.api.model.networking.v1.HTTPIngressRuleValueBuilder) IngressRulePathConfig(org.eclipse.jkube.kit.config.resource.IngressRulePathConfig)

Aggregations

HTTPIngressRuleValueBuilder (io.fabric8.kubernetes.api.model.networking.v1.HTTPIngressRuleValueBuilder)1 IngressRuleBuilder (io.fabric8.kubernetes.api.model.networking.v1.IngressRuleBuilder)1 IngressRulePathConfig (org.eclipse.jkube.kit.config.resource.IngressRulePathConfig)1