vmware-archive / octant

Highly extensible platform for developers to better understand the complexity of Kubernetes clusters.
https://octant.dev
Apache License 2.0
6.28k stars 486 forks source link

Change default shell to bash #1533

Closed akshaysgithub closed 3 years ago

akshaysgithub commented 3 years ago

Hello,

First of all, Thank you for such an amazing software. It works great. :-)

When we login into a pod, the default shell is set to sh. Sh is very limited, because of which whenever I am logging into a pod, I am passing the command su -c bash. Can we change the default shell to bash or is there some way we can pass pod startup command, so I can change shell there. Kindly let me know. Thank you.

Regards, Akshay Sulakhe

mklanjsek commented 3 years ago

Thank you for opening, this is something we are planning to add to Octant Preferences, should be coming out shortly.

GuessWhoSamFoo commented 3 years ago

A straightforward solution taken from kubernetes dashboard would be to try bash, sh, powershell, cmd until one creates a terminal.

It looks like the request here isn't necessarily a custom exec command but the ability to exec as a user in a manner similar to https://github.com/jordanwilson230/kubectl-plugins/tree/krew#kubectl-exec-as

wwitzel3 commented 3 years ago

I've assigned this to @GuessWhoSamFoo because his #1103 container work has code doing just this.

lloydchang commented 3 years ago

To Whom It May Concern:

Consider upgrading to Octant v0.19.0 if you're using Octant v0.17.0 and v0.18.0.

Why: Feature Change default shell to bash #1533's initial implementation, Add support for windows shells and bash #1749 released in v0.17.0 and v0.18.0, has a bug of:

OCI runtime exec failed: ...
(process exited)

with operating systems without bash, e.g. Alpine Linux with sh only.

A bug fix increase timeout for remote cmd stream setup #2258 released in v0.19.0, fixed a similar bug No option to choose the interpreter on the terminal #2164.

After the bug fix, operating systems without bash, such as Alpine Linux, can start sh successfully.

Thank you.