diff --git a/bundle/tests/scorecard/minikube-kuttl/ingress/01-assert.yaml b/bundle/tests/scorecard/minikube-kuttl/ingress/01-assert.yaml index 8902dd486..e7f2fa356 100644 --- a/bundle/tests/scorecard/minikube-kuttl/ingress/01-assert.yaml +++ b/bundle/tests/scorecard/minikube-kuttl/ingress/01-assert.yaml @@ -6,3 +6,16 @@ status: replicas: 1 readyReplicas: 1 updatedReplicas: 1 +--- +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: ingress +spec: + rules: + - host: myapp.mycompany.com + http: + paths: + - path: / + pathType: ImplementationSpecific + diff --git a/bundle/tests/scorecard/minikube-kuttl/ingress/01-default-pathtype.yaml b/bundle/tests/scorecard/minikube-kuttl/ingress/01-default-pathtype.yaml new file mode 100644 index 000000000..258673a2c --- /dev/null +++ b/bundle/tests/scorecard/minikube-kuttl/ingress/01-default-pathtype.yaml @@ -0,0 +1,10 @@ +apiVersion: rc.app.stacks/v1beta2 +kind: RuntimeComponent +metadata: + name: ingress +spec: + # Add fields here + route: + host: myapp.mycompany.com + path: "/" + pathType: diff --git a/bundle/tests/scorecard/minikube-kuttl/ingress/02-assert.yaml b/bundle/tests/scorecard/minikube-kuttl/ingress/02-assert.yaml new file mode 100644 index 000000000..8902dd486 --- /dev/null +++ b/bundle/tests/scorecard/minikube-kuttl/ingress/02-assert.yaml @@ -0,0 +1,8 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ingress +status: + replicas: 1 + readyReplicas: 1 + updatedReplicas: 1 diff --git a/bundle/tests/scorecard/minikube-kuttl/ingress/01-delete-ingress.yaml b/bundle/tests/scorecard/minikube-kuttl/ingress/02-delete-ingress.yaml similarity index 100% rename from bundle/tests/scorecard/minikube-kuttl/ingress/01-delete-ingress.yaml rename to bundle/tests/scorecard/minikube-kuttl/ingress/02-delete-ingress.yaml diff --git a/bundle/tests/scorecard/minikube-kuttl/ingress/01-errors.yaml b/bundle/tests/scorecard/minikube-kuttl/ingress/02-errors.yaml similarity index 100% rename from bundle/tests/scorecard/minikube-kuttl/ingress/01-errors.yaml rename to bundle/tests/scorecard/minikube-kuttl/ingress/02-errors.yaml diff --git a/doc/user-guide-v1beta2.adoc b/doc/user-guide-v1beta2.adoc index 2cb64934e..c4e9f4d81 100644 --- a/doc/user-guide-v1beta2.adoc +++ b/doc/user-guide-v1beta2.adoc @@ -586,7 +586,7 @@ spec: ===== Advanced Ingress configuration: -Most of the Ingress configuraiton is achieved through annotations. Annotations such as Nginx, HAProxy, Traefik, and others are specific to the ingress controller implementation. +Most of the Ingress configuration is achieved through annotations. Annotations such as Nginx, HAProxy, Traefik, and others are specific to the ingress controller implementation. You can provide an existing TLS secret and set a custom hostname. diff --git a/utils/utils.go b/utils/utils.go index d98cb7b71..74cd74d02 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -901,7 +901,8 @@ func CustomizeIngress(ing *networkingv1.Ingress, ba common.BaseComponent) { servicePort := strconv.Itoa(int(ba.GetService().GetPort())) + "-tcp" host := "" path := "" - var pathType networkingv1.PathType + pathType := networkingv1.PathType("") + rt := ba.GetRoute() if rt != nil { host = rt.GetHost() @@ -924,6 +925,10 @@ func CustomizeIngress(ing *networkingv1.Ingress, ba common.BaseComponent) { l.Info("No Ingress hostname is provided. Ingress might not function correctly without hostname. It is recommended to set Ingress host or to provide default value through operator's config map.") } + if pathType == "" { + pathType = networkingv1.PathTypeImplementationSpecific + } + ing.Spec.Rules = []networkingv1.IngressRule{ { Host: host,