Merge pull request #1061 from WTFKr0/replace_underscores_in_url
Replace underscores to dash in autogenerated urls (docker provider)
This commit is contained in:
commit
28054a0be3
2 changed files with 3 additions and 3 deletions
|
@ -110,7 +110,7 @@ func (s *DockerSuite) TestDefaultDockerContainers(c *check.C) {
|
||||||
client := &http.Client{}
|
client := &http.Client{}
|
||||||
req, err := http.NewRequest("GET", "http://127.0.0.1:8000/version", nil)
|
req, err := http.NewRequest("GET", "http://127.0.0.1:8000/version", nil)
|
||||||
c.Assert(err, checker.IsNil)
|
c.Assert(err, checker.IsNil)
|
||||||
req.Host = fmt.Sprintf("%s.docker.localhost", name)
|
req.Host = fmt.Sprintf("%s.docker.localhost", strings.Replace(name, "_", "-", -1))
|
||||||
resp, err := client.Do(req)
|
resp, err := client.Do(req)
|
||||||
|
|
||||||
c.Assert(err, checker.IsNil)
|
c.Assert(err, checker.IsNil)
|
||||||
|
|
|
@ -595,9 +595,9 @@ func parseContainer(container dockertypes.ContainerJSON) dockerData {
|
||||||
return dockerData
|
return dockerData
|
||||||
}
|
}
|
||||||
|
|
||||||
// Escape beginning slash "/", convert all others to dash "-"
|
// Escape beginning slash "/", convert all others to dash "-", and convert underscores "_" to dash "-"
|
||||||
func (provider *Docker) getSubDomain(name string) string {
|
func (provider *Docker) getSubDomain(name string) string {
|
||||||
return strings.Replace(strings.TrimPrefix(name, "/"), "/", "-", -1)
|
return strings.Replace(strings.Replace(strings.TrimPrefix(name, "/"), "/", "-", -1), "_", "-", -1)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (provider *Docker) listServices(ctx context.Context, dockerClient client.APIClient) ([]dockerData, error) {
|
func (provider *Docker) listServices(ctx context.Context, dockerClient client.APIClient) ([]dockerData, error) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue