1
0
Fork 0

Removes templates

This commit is contained in:
Gérald Croës 2018-07-23 11:56:02 +02:00 committed by Traefiker Bot
parent d8f69700e6
commit f611ef0edd
42 changed files with 37 additions and 8397 deletions

View file

@ -18,7 +18,7 @@ import (
"github.com/hashicorp/consul/api"
)
func (p *Provider) buildConfigurationV2(catalog []catalogUpdate) *types.Configuration {
func (p *Provider) buildConfiguration(catalog []catalogUpdate) *types.Configuration {
var funcMap = template.FuncMap{
"getAttribute": p.getAttribute,
"getTag": getTag,
@ -194,7 +194,8 @@ func getServerName(node *api.ServiceEntry, index int) string {
}
func (p *Provider) getWeight(tags []string) int {
weight := p.getIntAttribute(label.SuffixWeight, tags, label.DefaultWeight)
labels := tagsToNeutralLabels(tags, p.Prefix)
weight := label.GetIntValue(labels, p.getPrefixedName(label.SuffixWeight), label.DefaultWeight)
// Deprecated
deprecatedWeightTag := "backend." + label.SuffixWeight
@ -202,7 +203,7 @@ func (p *Provider) getWeight(tags []string) int {
log.Warnf("Deprecated configuration found: %s. Please use %s.",
p.getPrefixedName(deprecatedWeightTag), p.getPrefixedName(label.SuffixWeight))
weight = p.getIntAttribute(deprecatedWeightTag, tags, label.DefaultWeight)
weight = label.GetIntValue(labels, p.getPrefixedName(deprecatedWeightTag), label.DefaultWeight)
}
return weight