Fix sticky session not set for host in server-alias annotation (#6448)

This commit is contained in:
qianyong 2020-12-14 18:22:01 +08:00
parent 9c0a39636d
commit 44aaa2e367
2 changed files with 50 additions and 0 deletions

View file

@ -651,6 +651,15 @@ func (n *NGINXController) getBackendServers(ingresses []*ingress.Ingress) ([]*in
locs[host] = []string{}
}
locs[host] = append(locs[host], path.Path)
if len(server.Aliases) > 0 {
for _, alias := range server.Aliases {
if _, ok := locs[alias]; !ok {
locs[alias] = []string{}
}
locs[alias] = append(locs[alias], path.Path)
}
}
}
}
}