Fix sticky session for ingress without host
This commit is contained in:
parent
8db541e24b
commit
6c92c80073
4 changed files with 75 additions and 5 deletions
|
|
@ -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{
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue