forked from Ivasoft/traefik
In DNSRR there is no Endpoint.VirtualIPs - use Spec.TaskTemplate.Networks
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
This commit is contained in:
@@ -510,17 +510,17 @@ func (p *Provider) parseService(ctx context.Context, service swarmtypes.Service,
|
||||
if service.Spec.EndpointSpec.Mode == swarmtypes.ResolutionModeDNSRR {
|
||||
if dData.ExtraConf.Docker.LBSwarm {
|
||||
dData.NetworkSettings.Networks = make(map[string]*networkData)
|
||||
for _, virtualIP := range service.Endpoint.VirtualIPs {
|
||||
networkService := networkMap[virtualIP.NetworkID]
|
||||
for _, net := range service.Spec.TaskTemplate.Networks {
|
||||
networkService := networkMap[net.Target]
|
||||
if networkService != nil {
|
||||
network := &networkData{
|
||||
Name: networkService.Name,
|
||||
ID: virtualIP.NetworkID,
|
||||
ID: net.Target,
|
||||
Addr: "tasks." + service.Spec.Name,
|
||||
}
|
||||
dData.NetworkSettings.Networks[network.Name] = network
|
||||
} else {
|
||||
logger.Debug().Msgf("Network not found, id: %s", virtualIP.NetworkID)
|
||||
logger.Debug().Msgf("Network not found, id: %s", net.Target)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user