1
0
Fork 0

Fix empty address for registering service without IP

This commit is contained in:
Michael 2019-11-14 11:10:06 +01:00 committed by Traefiker Bot
parent ca1d980746
commit 2ee2e29262
3 changed files with 45 additions and 1 deletions

View file

@ -157,10 +157,15 @@ func (p *Provider) getConsulServicesData(ctx context.Context) ([]itemData, error
for _, consulService := range consulServices {
labels := tagsToNeutralLabels(consulService.ServiceTags, p.Prefix)
address := consulService.ServiceAddress
if address == "" {
address = consulService.Address
}
item := itemData{
ID: consulService.ServiceID,
Name: consulService.ServiceName,
Address: consulService.ServiceAddress,
Address: address,
Port: strconv.Itoa(consulService.ServicePort),
Labels: labels,
Status: consulService.Checks.AggregatedStatus(),