Connect: return logged in user in ListRootClusters#20809
Conversation
Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
… with optional properties
| config.Auth.NetworkingConfig.SetProxyListenerMode(types.ProxyListenerMode_Multiplex) | ||
| }), | ||
| ) | ||
| pack.WaitForLeaf(t) |
There was a problem hiding this comment.
TODO: remove leaf cluster
There was a problem hiding this comment.
Let's skip that. I was thinking about it but sooner or later we'll need a test which needs a leaf cluster anyway and so far no other test suite would benefit from being able to skip setting up a leaf cluster (AFAIR).
| apiCluster := newAPIRootCluster(cluster.Cluster) | ||
|
|
||
| // Only include if they exist on the supplied cluster | ||
| if cluster.Features != nil { |
There was a problem hiding this comment.
I think we can get rid of this if now?
ListRootClustersListRootClusters
We had a discussion about it here: #17497 (comment) |
|
Thanks for the link, I completely forgot about it. |
avatus
left a comment
There was a problem hiding this comment.
This is fine and was another option to do it this way originally. I think your logic makes sense that we were adding a few more fields. Honestly, this kind of just comes down to dev preference at this point. I'm ok with it either way and must admit, it's a bit neater/cleaner this way.
| apiCluster := newAPIRootCluster(cluster.Cluster) | ||
|
|
||
| // Only include if they exist on the supplied cluster | ||
| if cluster.Features != nil { |
ravicious
left a comment
There was a problem hiding this comment.
I like the new approach, I left some comments mostly related to code comments and small improvements in tests.
ravicious
left a comment
There was a problem hiding this comment.
We should probably backport it to v11 too, don't we? In theory it fixes a "bug" that was introduced in v11.
|
I'm sorry, I thought I approved this last week. Looks awesome |
* Add integration/teleterm_test with tests for get* and list* clusters Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com> * Move `testAddingRootCluster to integration/teleterm_test * Add `ClusterWithDetails` type instead of enriching existing `Cluster` with optional properties * Remove unnecessary condition * Add license * Bunch of renames * Do more in mustLogin * Remove watcher --------- Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com> (cherry picked from commit 7ed92c1)
* Add integration/teleterm_test with tests for get* and list* clusters Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com> * Move `testAddingRootCluster to integration/teleterm_test * Add `ClusterWithDetails` type instead of enriching existing `Cluster` with optional properties * Remove unnecessary condition * Add license * Bunch of renames * Do more in mustLogin * Remove watcher --------- Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
Closes #20670
This PR adds two integration tests for Connect RPC service to make sure we will not break it accidentally in the future.
To fix the actual issue, I add new cluster type
ClusterWithDetails. It is quite similar to the struct that Michael introduced here, but then it was replaced with enriching theClusterstruct during the review.IMO having one type that is enriched with some methods is problematic. You can't easily tell which fields are available and which are not.
I'm not 100% happy with having
RequestableRolesandSuggestedReviewersdirectly inClusterWithDetails, but I didn't want to complicate it by adding anotherUserDetails(?) struct. We can do it later when we have more fields.