Skip to content
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

[v2.9] Fix panic on context switch #387

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

enrichman
Copy link
Contributor

@enrichman enrichman commented Sep 4, 2024

Ref: rancher/rancher#46869


Switching an empty context will cause a panic.

Added an ErrNoServerSelected error on the FocusedServer() func to force the check of a valid focused server.

* added bool check for missing focused server, fixed panic

* added main branch to FOSSA workflow

* return error instead of bool
@enrichman enrichman requested a review from a team as a code owner September 4, 2024 09:12
@enrichman enrichman changed the title Fix panic on context switch [v2.9] Fix panic on context switch Sep 4, 2024
Copy link

@bigkevmcd bigkevmcd left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@enrichman enrichman merged commit 95f73b5 into rancher:v2.9 Sep 4, 2024
1 check passed
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.9] Rancher CLI panics when we try to switch context without any selection
4 participants