Open kamaradclimber opened 8 years ago
mesos-consul currently strips '_'s from the task name.
my_group_application.16836b3f-d40e-11e5-b006-c4346bb5c9dc
would be registered as
mygroupapplication.16836b3f-d40e-11e5-b006-c4346bb5c9dc
I'm not sure what else we can do. It would be nice to register it as /my/group/application
in Consul but the service API doesn't support grouping.
thanks for your response.
I think service name would make more sense if the underscore was replaced by an hyphen. It would reflect the hierarchy that marathon users are trying to define.
What do you think?
Maybe we could have this as an option?
@ChrisAubuchon would you accept a PR to replace _
by -
instead of blank ?
Would you prefer to have the replacement character passed as an option and default to blank ?
Sure. I don't have a preference to be honest. It'd be nice if consul had service groups though.
Sadly, I thought mesos-consul uses the task ID to name the service and just discovered it uses the tasks name.
In the case of marathon, task name are completely different when using a folder
The application /my_group/application
in marathon will be named application.my_group
.
I need to find another patch.
The behavior is challenged in mesosphere/marathon#3163
I've implemented a patch to use the taskID instead of the taskName to name services. https://github.com/criteo-forks/mesos-consul/commit/1ff7a6b1f5aac637d46a526e1fd1a1fdb45c11da
However I thinks this is very specific (will help only marathon users and might break other frameworks users).
@ChrisAubuchon coudl you reopen this issue ? I would be glad to take your input on a way to solve the issue.
Marathon framework recently introduced folders to group application.
The effect on mesos task is to prefix the task name by the name of the prefix and an underscore. For instance:
will have tasks named:
Consul recommends to use dns compatible names which does not include underscores.
What would be you recommendation to cope with those names? Could we consider a way to rewrite task names to replace underscores ?