Remove the trailing dot if the domain is not defined.
This commit is contained in:
parent
638960284e
commit
c7df82e695
8 changed files with 46 additions and 15 deletions
|
@ -141,7 +141,11 @@ func (p *Provider) getFrontendRule(i ecsInstance) string {
|
|||
}
|
||||
|
||||
domain := label.GetStringValue(i.SegmentLabels, label.TraefikDomain, p.Domain)
|
||||
defaultRule := "Host:" + strings.ToLower(strings.Replace(i.Name, "_", "-", -1)) + "." + domain
|
||||
if len(domain) > 0 {
|
||||
domain = "." + domain
|
||||
}
|
||||
|
||||
defaultRule := "Host:" + strings.ToLower(strings.Replace(i.Name, "_", "-", -1)) + domain
|
||||
|
||||
return label.GetStringValue(i.TraefikLabels, label.TraefikFrontendRule, defaultRule)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue