mantl / mesos-consul

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

Preserve task tags when registering with discovery info #76

Closed dylanmei closed 8 years ago

dylanmei commented 8 years ago

Tags have been getting lost when registering tasks that also include discovery info.

Before-and-after example

Before the change (with some fields omitted)

$ curl -s consul:8500/v1/catalog/service/elasticsearch | jq .
[{
    "Node": "mesos-follower-1",
    "ServiceName": "elasticsearch",
    "ServiceTags": [
      "CLIENT_PORT"
    ],
    "ServicePort": 9200
  }, {
    "Node": "mesos-follower-1",
    "ServiceName": "elasticsearch",
    "ServiceTags": [
      "TRANSPORT_PORT"
    ],
    "ServicePort": 9300
}]

After the change, notice test is included in ServiceTags.

$ curl -s consul:8500/v1/catalog/service/elasticsearch | jq .
[{
    "Node": "mesos-follower-1",
    "ServiceName": "elasticsearch",
    "ServiceTags": [
      "test",
      "CLIENT_PORT"
    ],
    "ServicePort": 9200
  }, {
    "Node": "mesos-follower-1",
    "ServiceName": "elasticsearch",
    "ServiceTags": [
      "test",
      "TRANSPORT_PORT"
    ],
    "ServicePort": 9300
}]
ChrisAubuchon commented 8 years ago

Looks good. Thanks!

dylanmei commented 8 years ago

Awesome. Cheers!