-
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
Fix database role fetch for tsh db ls --all
#13617
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.
Can we extract the role set fetching into a common function that listDatabasesAllClusters
and onListDatabases
both call? That would help ensure that we don't deviate again in the future and would also allow others that need to do this to not fall into the same trap.
I think v9 is also affected, hence adding the backport-v9 label. |
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.
Confirmed to work now:
$ tsh db ls --all
Proxy Cluster Name Description Allowed Users Labels Connect
------------------- -------------- ----------------------- ------------------- ------------------------- ---------------- ------------------------------
boson.tener.io:3080 boson.tener.io > mymongo (user: alice) [alice bob tener] env=dev tsh db connect --db-name=<n...
boson.tener.io:3080 boson.tener.io mymongo-insecure [alice bob tener] env=dev
boson.tener.io:3080 boson.tener.io redisboson Boson Redis example [alice bob tener] env=dev
boson.tener.io:3080 quark.tener.io qmongo [* alice bob quark tener] cl=quark
boson.tener.io:3080 quark.tener.io qmongo-insecure [* alice bob quark tener] cl=quark
boson.tener.io:3080 quark.tener.io redisquark Quark Redis example [* alice bob quark tener] cl=quark,env=dev
Thanks for the quick fix 🥳
#12281 fixed fetching db users for remote clusters for `tsh db ls`. #13617 applied the same fix to `tsh db ls --all` and extracted the `fetchRoleSet` function. This commit extracts it to `lib/client` so that we can reuse it in `lib/teleterm`. Other than accepting `log` as an argument, nothing was changed about that function.
This PR fixes the logic for fetching up-to-date roles in
tsh db ls --all
. The logic is now the same astsh db ls
.Related: #13340 (comment)