Skip to content

fix: Fix panic on tsh device enroll --current-device#32694

Merged
codingllama merged 2 commits intomasterfrom
codingllama/current-device-panic
Sep 28, 2023
Merged

fix: Fix panic on tsh device enroll --current-device#32694
codingllama merged 2 commits intomasterfrom
codingllama/current-device-panic

Conversation

@codingllama
Copy link
Copy Markdown
Contributor

@codingllama codingllama commented Sep 27, 2023

Fix a panic that happens on tsh device enroll --current-device when the device wasn't previously registered and the subsequent enrollment fails (for example, because the cluster devices limit was reached).

Fixes #31816.

Changelog: Fix panic on tsh device enroll --current-device when the cluster has reached its devices limit.

@github-actions github-actions Bot added size/sm tsh tsh - Teleport's command line tool for logging into nodes running Teleport. labels Sep 27, 2023
enrolled, err := c.Run(ctx, devicesClient, debug, token)
if err != nil {
return enrolled, outcome, trace.Wrap(err)
return currentDev, outcome, trace.Wrap(err)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This line is the bugfix proper, everything else is the cherry on top.

@codingllama
Copy link
Copy Markdown
Contributor Author

Unit tested and manually confirmed as well.

@codingllama
Copy link
Copy Markdown
Contributor Author

Thanks for the quick review!

@codingllama codingllama added this pull request to the merge queue Sep 28, 2023
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 28, 2023
@codingllama codingllama added this pull request to the merge queue Sep 28, 2023
Merged via the queue into master with commit 32bcd71 Sep 28, 2023
@codingllama codingllama deleted the codingllama/current-device-panic branch September 28, 2023 14:33
@public-teleport-github-review-bot
Copy link
Copy Markdown

@codingllama See the table below for backport results.

Branch Result
branch/v13 Create PR
branch/v14 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.

"tsh device enroll --current-device" panics when limit exceeds in Team plan

3 participants