fix(consul-provider): Compare consul catalog tag keys with lowered case

This commit is contained in:
Samuel BERTHE 2016-04-19 09:58:31 +02:00
parent 0332e32293
commit 45d6a326cd

View file

@ -125,8 +125,8 @@ func (provider *ConsulCatalog) getFrontendRule(service serviceUpdate) string {
func (provider *ConsulCatalog) getAttribute(name string, tags []string, defaultValue string) string {
for _, tag := range tags {
if strings.Index(tag, DefaultConsulCatalogTagPrefix+".") == 0 {
if kv := strings.SplitN(tag[len(DefaultConsulCatalogTagPrefix+"."):], "=", 2); len(kv) == 2 && kv[0] == name {
if strings.Index(strings.ToLower(tag), DefaultConsulCatalogTagPrefix+".") == 0 {
if kv := strings.SplitN(tag[len(DefaultConsulCatalogTagPrefix+"."):], "=", 2); len(kv) == 2 && strings.ToLower(kv[0]) == strings.ToLower(name) {
return kv[1]
}
}