1
0
Fork 0

Remove the trailing dot if the domain is not defined.

This commit is contained in:
Ludovic Fernandez 2018-10-23 17:36:05 +02:00 committed by Traefiker Bot
parent 638960284e
commit c7df82e695
8 changed files with 46 additions and 15 deletions

View file

@ -128,7 +128,11 @@ func (p *Provider) serviceFilter(service rancherData) bool {
func (p *Provider) getFrontendRule(serviceName string, labels map[string]string) string {
domain := label.GetStringValue(labels, label.TraefikDomain, p.Domain)
defaultRule := "Host:" + strings.ToLower(strings.Replace(serviceName, "/", ".", -1)) + "." + domain
if len(domain) > 0 {
domain = "." + domain
}
defaultRule := "Host:" + strings.ToLower(strings.Replace(serviceName, "/", ".", -1)) + domain
return label.GetStringValue(labels, label.TraefikFrontendRule, defaultRule)
}