Skip to content
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

Merged
merged 13 commits into from
Oct 2, 2024

Conversation

strideynet
Copy link
Contributor

@strideynet strideynet commented Sep 19, 2024

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.

@strideynet strideynet added the no-changelog Indicates that a PR does not require a changelog entry label Sep 19, 2024
@strideynet strideynet marked this pull request as ready for review September 19, 2024 16:16
@github-actions github-actions bot added size/lg tctl tctl - Teleport admin tool labels Sep 19, 2024
lib/auth/authclient/api.go Show resolved Hide resolved
lib/auth/grpcserver.go Show resolved Hide resolved
DeleteReverseTunnel(ctx context.Context, tunnelName string) error
}

type Cache interface {
Copy link
Contributor

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 😬?

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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 😅

Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor

@rosstimothy rosstimothy left a 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 !

@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from Joerger October 2, 2024 08:38
@strideynet strideynet added this pull request to the merge queue Oct 2, 2024
Merged via the queue into master with commit 8a85342 Oct 2, 2024
42 checks passed
@strideynet strideynet deleted the strideynet/migrate-reversetunnels-http-to-grpc branch October 2, 2024 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Indicates that a PR does not require a changelog entry size/lg tctl tctl - Teleport admin tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants