feat(exec): allow interactive (autodetected) shell - #3156
Conversation
pimvanpelt
commented
Apr 4, 2026
This tool looks up the active lab containers (globally, or restricted by --topo or --name), and allows the user to specify any container with a substring match. It will use 'docker exec' to connect to, and run a default shell, by imagename, or by the --shell flag. If no containername is given, a list is provided. If the given substring is ambiguous, the available choices are provided as a list. Fixes srl-labs#3155
|
This is a proof of concept, although it works well. It probably needs work for |
| imageKey string | ||
| argv []string | ||
| }{ | ||
| {"ceos", []string{"/usr/bin/Cli", "-p", "15"}}, |
There was a problem hiding this comment.
nono no... please don't do it like that...
This is obviousely kind dependent... so make it a field in the kind implementation (and default kind) and expose it via a getter function... don't start all over again with polluting the code in every corner with kind specifics.
There was a problem hiding this comment.
the default kind then might do something fuzzy stuff of trying bash first and sh there after or so...
| case nodeKnown && node.Config().Shell != "": | ||
| shell = strings.Fields(node.Config().Shell) | ||
| case nodeKnown: | ||
| shell = node.ExecInteractiveShell() |
There was a problem hiding this comment.
still execinteractiveshell is missleading...
also see my comment here:
2b5bb90#r181794850
| // ExecInteractiveShell returns the argv for the interactive shell to use | ||
| // when the user runs 'exec --interactive'. Nodes override this to provide | ||
| // their NOS CLI or a specific shell invocation. | ||
| ExecInteractiveShell() []string |
There was a problem hiding this comment.
This is rather GetInteractiveShellCommand... not ExecInteractiveShell ... nothing is executed really when calling this function