Fix sticky session for ingress without host

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-12-28 19:56:13 -03:00
parent 8db541e24b
commit 6c92c80073
4 changed files with 75 additions and 5 deletions

View file

@ -447,7 +447,6 @@ func newSingleIngressWithRules(name, path, host, ns, service string, port int, a
spec := networking.IngressSpec{
Rules: []networking.IngressRule{
{
Host: host,
IngressRuleValue: networking.IngressRuleValue{
HTTP: &networking.HTTPIngressRuleValue{
Paths: []networking.HTTPIngressPath{
@ -465,6 +464,11 @@ func newSingleIngressWithRules(name, path, host, ns, service string, port int, a
},
}
// allow ingresses without host field
if host != "" {
spec.Rules[0].Host = host
}
if len(tlsHosts) > 0 {
spec.TLS = []networking.IngressTLS{
{