mantl / mesos-consul

Mesos to Consul bridge for service discovery
Apache License 2.0
338 stars 95 forks source link

Replace _ from mesos task name by - #64

Closed kamaradclimber closed 8 years ago

kamaradclimber commented 8 years ago

Previously underscores where removed when creating the service name. This usually does not correspond to the intent of the user since he set a separator in the task name.

In the specific case of marathon, the folder separator is converted to underscore when creating a mesos task.

Users in marathon sets: /mygroup/mysubgroup/myapp

Tasks name is mesos are: mygroup_mysubgroup_myapp.[guid]

Before this patch, consul service names were mygroupmysubgroupmyapp After this patch, consul service names are mygroup-mysubgroup-myapp.

Fixes #63

kamaradclimber commented 8 years ago

@ChrisAubuchon I've implemented the configurable separator. The first commit hardcodes the hyphen separator, the second one makes it configurable.

I would be happy if any of these two commits are merged.

ChrisAubuchon commented 8 years ago

It doesn't look like the separator is configurable. There needs to be a flags.StringVar in main.go to allow command line configuration. Maybe flags.StringVar(&c.Separator, "group-separator", "", "")

kamaradclimber commented 8 years ago

you're right, fixed