Skip to content

Add a tsh sessions ls command#37740

Merged
zmb3 merged 1 commit intomasterfrom
zmb3/tsh-sessions-ls
Feb 8, 2024
Merged

Add a tsh sessions ls command#37740
zmb3 merged 1 commit intomasterfrom
zmb3/tsh-sessions-ls

Conversation

@zmb3
Copy link
Copy Markdown
Collaborator

@zmb3 zmb3 commented Feb 4, 2024

This deprecates tsh kube sessions in favor of a command that can be used to list all types of active sessions.

Closes #19152

Changelog: add a tsh sessions ls command to list active sessions.

@github-actions github-actions Bot added size/sm tsh tsh - Teleport's command line tool for logging into nodes running Teleport. labels Feb 4, 2024
Comment thread tool/tsh/common/tsh.go Outdated
This deprecates `tsh kube sessions` in favor of a command that
can be used to list all types of active sessions.

Closes #19152
@zmb3 zmb3 force-pushed the zmb3/tsh-sessions-ls branch from c42abe1 to a80ac93 Compare February 4, 2024 20:46
Comment thread tool/tsh/common/tsh.go
filtered := slices.DeleteFunc(sessions, func(st types.SessionTracker) bool {
return !slices.Contains(kinds, st.GetSessionKind())
})
sort.Slice(filtered, func(i, j int) bool {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure it if matters given how small the filtered slice is going to be, but, will slices.SortFunc be any more performant than sort.Slices?

Suggested change
sort.Slice(filtered, func(i, j int) bool {
slices.SortFunc(filtered, func(i, j int) int {

@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from camscale February 8, 2024 19:25
@zmb3 zmb3 enabled auto-merge February 8, 2024 20:16
@zmb3 zmb3 added this pull request to the merge queue Feb 8, 2024
Merged via the queue into master with commit ab8a629 Feb 8, 2024
@zmb3 zmb3 deleted the zmb3/tsh-sessions-ls branch February 8, 2024 23:17
@public-teleport-github-review-bot
Copy link
Copy Markdown

@zmb3 See the table below for backport results.

Branch Result
branch/v13 Create PR
branch/v14 Create PR
branch/v15 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/sm tsh tsh - Teleport's command line tool for logging into nodes running Teleport.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

List SSH sessions in TSH

3 participants