[DEL] remove CHash

This commit is contained in:
GLYASAI 2018-12-17 18:32:46 +08:00
parent d0432dd62c
commit 7ba3e8d94e
2 changed files with 10 additions and 5 deletions

View File

@ -46,9 +46,6 @@ var HTTPToHTTPS RuleExtensionKey = "httptohttps"
// LBType load balancer type
var LBType RuleExtensionKey = "lb-type"
// CHash consistent hashing
var CHash RuleExtensionKey = "chash"
// RuleExtension contains rule extensions for http rule or tcp rule
type RuleExtension struct {
Model

View File

@ -347,9 +347,17 @@ func (a *AppServiceBuild) applyHTTPRule(rule *model.HTTPRule, port *model.Tenant
}
annos[parser.GetAnnotationWithPrefix("force-ssl-redirect")] = "true"
case string(model.LBType):
if strings.HasPrefix(extension.Value, "upstream-hash-by") {
s := strings.Split(extension.Value, ":")
if len(s) < 2 {
logrus.Warningf("invalid extension value for upstream-hash-by: %s", extension.Value)
break
}
annos[parser.GetAnnotationWithPrefix("upstream-hash-by")] = s[1]
break
}
annos[parser.GetAnnotationWithPrefix("lb-type")] = extension.Value
case string(model.CHash):
annos[parser.GetAnnotationWithPrefix("upstream-hash-by")] = extension.Value
default:
logrus.Warnf("Unexpected RuleExtension Key: %s", extension.Key)
}