fix: docker service name.
This commit is contained in:
parent
29efac3e5e
commit
c8fa059064
3 changed files with 8 additions and 3 deletions
|
@ -77,7 +77,7 @@ func (s *DockerComposeSuite) TestComposeScale(c *check.C) {
|
||||||
services := rtconf.Services
|
services := rtconf.Services
|
||||||
c.Assert(services, checker.HasLen, 1)
|
c.Assert(services, checker.HasLen, 1)
|
||||||
for k, v := range services {
|
for k, v := range services {
|
||||||
c.Assert(k, checker.Equals, composeService+"_integrationtest"+composeProject+"@docker")
|
c.Assert(k, checker.Equals, composeService+"-integrationtest"+composeProject+"@docker")
|
||||||
c.Assert(v.LoadBalancer.Servers, checker.HasLen, serviceCount)
|
c.Assert(v.LoadBalancer.Servers, checker.HasLen, serviceCount)
|
||||||
// We could break here, but we don't just to keep us honest.
|
// We could break here, but we don't just to keep us honest.
|
||||||
}
|
}
|
||||||
|
|
|
@ -331,5 +331,5 @@ func getServiceName(container dockerData) string {
|
||||||
serviceName = values[labelDockerComposeService] + "_" + values[labelDockerComposeProject]
|
serviceName = values[labelDockerComposeService] + "_" + values[labelDockerComposeProject]
|
||||||
}
|
}
|
||||||
|
|
||||||
return serviceName
|
return provider.Normalize(serviceName)
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,12 @@ func (p *Provider) createClient() (client.APIClient, error) {
|
||||||
apiVersion = SwarmAPIVersion
|
apiVersion = SwarmAPIVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
return client.NewClient(p.Endpoint, apiVersion, httpClient, httpHeaders)
|
return client.NewClientWithOpts(
|
||||||
|
client.WithHost(p.Endpoint),
|
||||||
|
client.WithVersion(apiVersion),
|
||||||
|
client.WithHTTPClient(httpClient),
|
||||||
|
client.WithHTTPHeaders(httpHeaders),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Provide allows the docker provider to provide configurations to traefik using the given configuration channel.
|
// Provide allows the docker provider to provide configurations to traefik using the given configuration channel.
|
||||||
|
|
Loading…
Reference in a new issue