Replace underscores to dash in autogenerated urls (docker provider)

Signed-off-by: WTFKr0 <thomas.kovatchitch@gmail.com>
This commit is contained in:
WTFKr0 2017-01-24 11:29:45 +01:00 committed by Emile Vauge
parent db63e84a9f
commit 41f8f0113b
No known key found for this signature in database
GPG key ID: D808B4C167352E59

View file

@ -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) {