-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multiple tags for health and catalog http api endpoints #4717
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. My one request would be to use the require module in the new tests. I commented on it in a couple places but then realized it was everywhere so I didn't bother adding comments to every location.
agent/consul/health_endpoint_test.go
Outdated
|
||
nodes := out2.Nodes | ||
if len(nodes) != 1 { | ||
t.Fatalf("Bad: %v", nodes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For new tests I would recommend importing github.com/stretchr/testify/require
and using the functions in there.
This particular block:
if len(nodes) != 1 {
t.Fatalf("Bad: %v", nodes)
}
Can be replaced with:
require.Len(t, nodes, 1)
We already use this in many other places and its more ergonomic than tons of the if / Fatalf blocks
7ae8fd8
to
84012ce
Compare
Fixes #1781. Adds a `ServiceTags` field to the ServiceSpecificRequest to support multiple tags, updates the filter logic in the catalog store, and propagates these change through to the health and catalog endpoints. Note: Leaves `ServiceTag` in the struct, since it is being used as part of the DNS lookup, which in turn uses the health check.
Includes additional tests.
84012ce
to
98cdcaa
Compare
Was addressed but @mkeeler's not online yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All feedback adressed!
Fixes #1781.
Adds a
ServiceTags
field to the ServiceSpecificRequest to supportmultiple tags, updates the filter logic in the catalog store, and
propagates these change through to the health and catalog endpoints.
Note: Leaves
ServiceTag
in the struct, since it is being used aspart of the DNS lookup, which in turn uses the health check. This
singular field takes precedence over anything in
ServiceTags
.