1
0
Fork 0

Stickiness cookie name.

This commit is contained in:
Ludovic Fernandez 2017-10-12 17:50:03 +02:00 committed by Traefiker
parent cba0898e4f
commit 8cb3f0835a
21 changed files with 525 additions and 148 deletions

View file

@ -243,13 +243,17 @@ func (p *Provider) checkConstraints(keys ...string) bool {
}
func (p *Provider) hasStickinessLabel(rootPath string) bool {
stickiness, err := p.kvclient.Exists(rootPath + "/loadbalancer/stickiness")
if err != nil {
log.Debugf("Error occurs when check stickiness: %v", err)
}
sticky := p.get("false", rootPath, "/loadbalancer", "/sticky")
stickyValue := p.get("false", rootPath, "/loadbalancer", "/sticky")
return stickiness || (len(sticky) != 0 && strings.EqualFold(strings.TrimSpace(sticky), "true"))
sticky := len(stickyValue) != 0 && strings.EqualFold(strings.TrimSpace(stickyValue), "true")
if sticky {
log.Warnf("Deprecated configuration found: %s. Please use %s.", "loadbalancer/sticky", "loadbalancer/stickiness")
}
stickinessValue := p.get("false", rootPath, "/loadbalancer", "/stickiness")
stickiness := len(stickinessValue) > 0 && strings.EqualFold(strings.TrimSpace(stickinessValue), "true")
return stickiness || sticky
}
func (p *Provider) getStickinessCookieName(rootPath string) string {