Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: docker service name. #5491

Merged
merged 3 commits into from
Sep 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion integration/docker_compose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (s *DockerComposeSuite) TestComposeScale(c *check.C) {
services := rtconf.Services
c.Assert(services, checker.HasLen, 1)
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)
// We could break here, but we don't just to keep us honest.
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/provider/docker/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,5 +331,5 @@ func getServiceName(container dockerData) string {
serviceName = values[labelDockerComposeService] + "_" + values[labelDockerComposeProject]
}

return serviceName
return provider.Normalize(serviceName)
}
7 changes: 6 additions & 1 deletion pkg/provider/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,12 @@ func (p *Provider) createClient() (client.APIClient, error) {
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.
Expand Down