Repository navigation
Conversation
Part 2 of p10node#12. S resolves the same pod and container as s, quits k10s, and main.go runs the shell in the terminal k10s was started from, the way /update's relaunch works. k10s exits with the shell's exit code. - domain.AShellOut ("shellout"), key S, listed under s and offered where s is; not allowed in read-only. - Source.Shell is resolved off the UI goroutine. No shell (demo) toasts and stays; a failed lookup shows the error; a result that arrives after the view changed is dropped. - Store.Shell now uses logTarget like ShellSession, so it resolves workloads to a pod and returns ErrNoShell for kinds without one. - Help text, README, keybindings.md and ui.md say that S quits k10s. Signed-off-by: Ehab Kahwati <iehab.kahwati@gmail.com>
junior
approved these changes
Nov 12, 2026
junior
left a comment
Collaborator
There was a problem hiding this comment.
Nice one, thanks! I tried it merged with current main and everything passes, -race included. It conflicts with main now (both sides added a test at the end of main_test.go), and it touches the same spot in main.go as #44, so I can merge main in once v0.1.10 is out, unless you'd rather do it yourself. Let's get it in right after v0.1.10.
Contributor
Author
|
Thanks for testing it! I'll merge main in myself once #44 and v0.1.10 are in, so both conflicts get sorted in one go. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 2 of #12. Part 1 is #34, and they don't touch the same lines.
Sresolves the pod and container the same waysdoes, quits k10s, andmain.goruns the shell in the terminal k10s was started from afterp.Run()returns, same pattern as the/updaterelaunch. It printsk10s: shell into po/web-1 (namespace default) — exit the shell to get your prompt backfirst. k10s exits with the remote shell's exit code (CodeExitError), or 1 if the session itself fails.domain.AShellOut("shellout"), keyS, labelShell (terminal), right unders. It sits next toAShellinpodActions(k8s and mock) and isn't allowed in read-only.Source.Shellruns in atea.Cmd, since it's an API call. No shell (nil, nilorErrNoShell) shows the no-shell toast and stays, other errors show the error, and a result that arrives after the view changed is dropped so it can't quit under you.Store.ShelluseslogTargetlikeShellSessionand mapsErrNoLogstoErrNoShell.keybindings.mdandui.mdmention it and say it quits k10s.One difference from the issue:
Sis offered whereversis, and today that's only Pods (wlActionshas noAShell). So the "S on a Deployment" item isn't reachable from the UI yet.Store.Shelldoes resolve a Deployment to its pod now (tested), so addingAShell/AShellOuttowlActionsis all it would take. I left that out because it changes whatsoffers too. Also, since the lookup is async, the "returned cmd istea.Quit" check is on theUpdatethat receives the result, not onfireActionitself.Tests:
internal/ui/external_shell_test.gocovers quit +ExitShell(), the source staying open, the demo toast, a lookup error, a stale result, theSkey and the Actions pane.Sis added to the read-only key test andAShellOutto the domain read-only list. There's a k8s test thatShelllands on the same pod/container for a pod and a Deployment, and amain_test.gotest for the exit code. I checked the new tests fail when I break the matching code.gofmt -l,go vet ./...andgo test ./...pass, and the shell tests pass with-race. I haven't tried it against a live cluster.