-
Notifications
You must be signed in to change notification settings - Fork 28
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
client: bypass endpoint name resolution #477
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.
See comment
internal/client/client.go
Outdated
@@ -74,7 +75,7 @@ func newClientForContext(cmd *cobra.Command, contextName string, secretStore sto | |||
return nil, err | |||
} | |||
|
|||
return authzed.NewClient(token.Endpoint, dialOpts...) | |||
return authzed.NewClient(withPassthroughTarget(token.Endpoint), dialOpts...) |
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 hesitant about the way that this changes the behavior for all calls. Ideally we'd only include this behavior when explicitly using a proxy. Is there a way to rework this so that we only apply it when the proxy is defined?
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.
My current reading/understanding is that if you use the dns
resolver, which is the default, it attempts to do DNS resolution before creating connections, which allows it to get a list of available hosts for client-side load balancing. Otherwise it's deferring the resolution to the lib underlying the gRPC client, which means it will only have a single target and a single connection.
That may be sufficient given that zed
is a CLI utility, and it doesn't have the same performance requirements as (say) the dispatcher within SpiceDB.
I think I'd still prefer to minimize the possibility of surprising behaviors, which would point to leaving the default intact in as many cases as possible.
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.
sounds about right, changing this logic to be employed only when a proxy is specified.
fe0fde1
to
bac042c
Compare
Signed-off-by: Kartikay <[email protected]>
bac042c
to
4a4d8ce
Compare
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! Thank you!
Should fix #475
Works as per this (tested locally with socks5 proxy)