Skip to content

[v13] tsh and tctl ux backport#32005

Closed
GavinFrazar wants to merge 13 commits intobranch/v13from
gavinfrazar/v13-ux-jumbo-backport
Closed

[v13] tsh and tctl ux backport#32005
GavinFrazar wants to merge 13 commits intobranch/v13from
gavinfrazar/v13-ux-jumbo-backport

Conversation

@GavinFrazar
Copy link
Copy Markdown
Contributor

@GavinFrazar GavinFrazar commented Sep 16, 2023

This PR backports several tsh and tctl ux change PRs to branch/v13.

I batched them together because it would be a nightmare to resolve diff conflicts otherwise.

I was holding off on backporting these changes until after the v14 test plan was completed.

Leaving it in draft for now for CI run

PRs backported (from most recent to least recent merge into master):
#31689
#31744
#30531
#30478
#30252
#30167
#30081
#30196
#30149
#29887
#30024
#29562

The merge commits from these PRs were cherry-picked in the same order as they were committed to master.

the diff conflicts weren't too bad, but there were a few for several commits.

tigrato and others added 13 commits September 15, 2023 19:22
Backports #29562 to branch/v13.

This PR creates an automatic resource access request if `tsh kube login
<cluster>` fails because the user doesn't have the correct permissions
but is able to resquest access to the cluster.

Fixes #29532

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
backports #30024 to branch/v13.

* Deflake `TestListKube`
* Plumbing through custom kube config path

PR #29993 tried to deflake this test but only fixed it partially during
login.
This prevents the kubeconfig in `$HOME/.kube/config` to be used
everywhere
…format

backports #29887 to branch/v13.

* display discovered resource name in tctl output
* display the discovered name from label in non-verbose text format for
  db, db_server, kube_cluster, kube_server resources.
* support labels, predicate, search in tctl kube ls
* avoid type conversion in tctl db ls
* sort kube and db objects in tctl text tables
* test kube/database collection text format output
* check column indices are in range
backports #30149 to branch/v13.

* update tsh kube ls tests
* fix SiteName godoc typo
backports #30196 to branch/v13.

* factor out discovered name func from tsh and tctl into tool/common
backports #30081 to branch/v13.

* prefix matching for tctl get discovery resources:
  * kube_cluster
  * kube_server
  * db
  * db_server
  * skip 500ms wait for 0 databases in tests
backports #30167 to branch/v13.

* Fix Kubernetes selected cluster

Kubeconfig context name can be customized using `--set-context-name`
flag. When using it, the selected Kubernetes cluster fails to correctly
identify the cluster name.
backports #30252 to branch/v13.

* fetch kube clusters once for login
backports #30478 to branch/v13.

* select by labels, query predicate, name, and/or prefix of name.
* fix --cluster flag not being propagated
backports #31689 to branch/v13.

* disallow prefix matching
* select by exact name match first,
* otherwise look for unambiguous discovered name label match.
* look for an active db to resolve discovered name match ambiguity.
* add more predicate builder helpers
* check for db name in not found error for stale cert hint
* no error status on tsh db logout with no logged in dbs
* remove dead code
* refactor helper funcs to simplify code and make it easier to test
* test complex database selection
* test findActiveDatabase
* test choosing one db by discovered name
* add more resource selectors tests
* test formatDatabaseLoginCommand
* add debug logging for db selection
@GavinFrazar
Copy link
Copy Markdown
Contributor Author

GavinFrazar commented Sep 16, 2023

@smallinsky @greedy52 @tigrato

if this is too much for reviewers, I can split this into separate stacked backport PRs by cherry-picking from this branch, to spread the work around. 4k line diff is pretty ridiculous 🤣

edit: I think i'm just going to do after that this weekend, and just start merging the stacked PRs into branch/v13 once they're all approved. That way we can get multiple people to review.

@GavinFrazar
Copy link
Copy Markdown
Contributor Author

closing in favor of individual stacked backports.

@GavinFrazar GavinFrazar deleted the gavinfrazar/v13-ux-jumbo-backport branch October 5, 2023 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants