-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Migrate ReverseTunnel Resource APIs from HTTP to gRPC #46761
Migrate ReverseTunnel Resource APIs from HTTP to gRPC #46761
Conversation
DeleteReverseTunnel(ctx context.Context, tunnelName string) error | ||
} | ||
|
||
type Cache interface { |
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.
Should this include GetRemoteCluster and ListRemoteClusters as well 😬?
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.
Soo - when I converted RemoteClusters, I can recall that the GetRemoteClusters/GetRemoteCluster HTTP method called directly thru to the service rather than via the cache - and that this looked somewhat intentional (there was a method on auth.Server that just delegated the call to .Services). I was hesitant to change the behaviour to use the cache as part of the conversion.
More than happy to raise a PR to convert this to use the Cache if you feel that would be safe.
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.
Maybe add a comment indicating the two are explicitly meant to read from the backend then?
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.
Yeah - I had considered that but I wasn't really sure enough if it was intentional or not to codify it as intentional going forward and possibly dissuade someone from switching to the cache in future 😅
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.
@fspmarshall @espadolini any ideas or reasons for why remote clusters were always being read from the backend?
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 think it's for consistency when doing modifications but we should just not modify the RemoteCluster
object just for advisory purposes IMO, it should be treated as a relatively high importance marker object.
I don't see a lot of functional drawbacks to using the cache, but I don't know if UX would be impacted by not having the cluster in the listings and the web UI immediately after adding a new leaf.
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.
Thanks for the cleanup @strideynet !
Part of #6394
Creates gRPC equivelants for HTTP API methods related to the ReverseTunnel resource, and modifies the API client to try the new methods before falling back to the old methods.