Open RickyGrassmuck opened 4 years ago
@nathanejohnson Sorry, I had signed the CLA but had accidentally messed up the email address in one of the commits so it wasn't registering. Went ahead and squashed everything down to 1 commit and re-signed the CLA so it should be good now.
@rigrassm tentatively this looks good, could you add a test case in routecmd_test.go to cover this option. Now the interesting part here is this means consul registry will have a route option that doesn't exist otherwise. On the other hand, filtering doesn't make much sense in other cases. I went looking for documentation specific to consul tags and it's not really there other than a brief mention in the Quickstart. I would have asked you to update that documentation, but since it doesn't exist I'll make it a point to create that page and roll it out with the next release.
TLDR; add a test case and I'll merge this.
The new tag
only=
allows the user to have more granular control over which checked services get added to the routing table.Example: Nomad publishes service checks for the HTTP, RPC, and Serf services to consul. Registering the tag below results in a routing table that splits requests for nomad.service.example.com between the three different protocols.
Service Tag
Resulting Routing Table Entries
Since we really only want to route the HTTP traffic, this commit allows you to use the rule below to only generate a single routing table entry based on the port number associated with our HTTP port.
Service Tag
Resulting Routing Table Entries