-
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
Ui Service Dump Gateway Enhancements #8411
Conversation
Overall, I do like this better than the way I dealt with it in my PR! 👍 |
agent/consul/internal_endpoint.go
Outdated
|
||
reply.Index, reply.Nodes = index, nodes | ||
if err := m.srv.filterACL(args.Token, reply); err != nil { | ||
if err := m.srv.filterACL(args.Token, reply.Nodes); err != nil { |
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.
Something weird is happening with the ACL filtering, causing a test to fail? https://app.circleci.com/pipelines/github/hashicorp/consul/11574/workflows/99efb4ba-e98f-4889-919e-26d98efab9a2/jobs/216919
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.
Yep, it needed a pointer: https://github.com/hashicorp/consul/blob/master/agent/consul/acl.go#L1843
Should this line be updated to consul/agent/proxycfg/state.go Line 759 in de0b574
I see tests passing locally, but I would have expected something to fail here. 🤔 |
@crhino that was certainly making integration tests fail, fixed. |
Ah, merging #8704 caused conflicts with this, should be easy to rebase on top of |
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.
LGTM, with one comment about confusing output in the two API endpoints that use summarizeService
. That shouldn't matter for the usage we have in mind now, but is something to think about in the future/when refactoring.
agent/ui_endpoint.go
Outdated
@@ -199,18 +200,22 @@ RPC: | |||
return nil, err | |||
} | |||
|
|||
return summarizeServices(out.Dump, s.agent.config), nil |
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.
The more /v1/internal/ui/gateway-services-nodes/<name>
and /v1/internal/ui/services
diverge, the more awkward it feels using summarizeServices
to account for both. I got confused because I was accidentally testing out /v1/internal/ui/gateway-services-nodes/gateway-name
and ConnectedWithGateway
/ConnectedWithProxy
were false
for services that did have proxies and gateways. Eventually I realized that endpoint does not pass in a list of gateways here, which accounts for that difference. Definitely feels a bit weird though.
Perhaps we can put a TODO
here about refactoring this to make the two endpoints more separate? Or somehow cleaning up the confusion of the output?
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.
I'm about to add a 3rd summary use-case in another PR 🙈 .
I'll address it there.
This PR adds some enhancements needed for additional UI functionality related to gateways:
ConnectedWithProxy
andConnectedWithGateway
track whether a service is proxied by a gateway or Connect proxy.GatewayConfig.AssociatedServiceCount
tracks the number of service names associated with a gatewayThe main change is that
Internal.ServiceDump
now returns a dump of thegateway-services
table, and we join the information from both of those on the client side.Backwards compatibility of the changes made to the return type of
Internal.ServiceDump
have been tested.Remaining TODO:
TestHTTPAPI_MethodNotAllowed_OSS
Internal.ServiceDump
RPC endpoint tests