Use the default ingress strategy if there is no value in CR (#346)

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
pull/347/head
Anatolii Bazko 2020-07-16 11:16:02 +03:00 committed by GitHub
parent a9092b21d6
commit 26c69782bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -49,7 +49,8 @@ func SyncDevfileRegistryToCluster(checluster *orgv1.CheCluster, clusterAPI Clust
}
}
if checluster.Spec.K8s.IngressStrategy == "multi-host" {
ingressStrategy := util.GetValue(checluster.Spec.K8s.IngressStrategy, DefaultIngressStrategy)
if ingressStrategy == "multi-host" {
host = DevfileRegistry + "-" + checluster.Namespace + "." + checluster.Spec.K8s.IngressDomain
} else {
host = checluster.Spec.K8s.IngressDomain + "/" + DevfileRegistry

View File

@ -111,7 +111,7 @@ func getClusterIngress(name string, namespace string, client runtimeClient.Clien
func getSpecIngress(checluster *orgv1.CheCluster, name string, serviceName string, port int, clusterAPI ClusterAPI) (*v1beta1.Ingress, error) {
tlsSupport := checluster.Spec.Server.TlsSupport
ingressStrategy := checluster.Spec.K8s.IngressStrategy
ingressStrategy := util.GetValue(checluster.Spec.K8s.IngressStrategy,DefaultIngressStrategy)
if len(ingressStrategy) < 1 {
ingressStrategy = "multi-host"
}

View File

@ -49,7 +49,8 @@ func SyncPluginRegistryToCluster(checluster *orgv1.CheCluster, clusterAPI Cluste
}
}
if checluster.Spec.K8s.IngressStrategy == "multi-host" {
ingressStrategy := util.GetValue(checluster.Spec.K8s.IngressStrategy, DefaultIngressStrategy)
if ingressStrategy == "multi-host" {
host = PluginRegistry + "-" + checluster.Namespace + "." + checluster.Spec.K8s.IngressDomain
} else {
host = checluster.Spec.K8s.IngressDomain + "/" + PluginRegistry