tilt icon indicating copy to clipboard operation
tilt copied to clipboard

Make it easy to have a button run its command inside a pod

Open landism opened this issue 4 years ago • 5 comments

Describe the Feature You Want

Easily define a UIButton that runs a command inside a resource's pod.

Current Behavior

UIButton's commands run on the host machine. A user can have a button trigger a command inside the pod by doing something like: cmd='kubectl exec "$(tilt get kd $RESOURCE_NAME -ojsonpath='{.status.pods[0].name}')" /path/to/command'

Why Do You Want This?

services often have cli admin interfaces that run inside their pods (e.g., pgsql), and triggering these with buttons could be useful

Additional context This is probably doable by a simple change to the uibutton extension that just wraps the command with something like the above kubectl exec.

landism avatar Jul 30 '21 16:07 landism

or we could have a kubectl_exec_button extension! more extensions!!! :1st_place_medal:

nicks avatar Jul 30 '21 16:07 nicks

Interesting thought @nicks 🤔. In this case there is so much overlap that extending it would be more convenient as a user.

jappievw avatar Jul 30 '21 18:07 jappievw

Providing this native would help keep tiltfiles cross-platform because stitching stuff together in exec is a headache of bash shell versions and powershell compatibility with available binaries. It's frustrating when I know tilt knows what resource to use right there and I've already made a container with the expected dependencies. Shelling out to stuff adds a massive variable.

Jackbennett avatar Sep 30 '22 09:09 Jackbennett

I also would like this. I cannot easily use tilt get .. because I'm running tilt with a non-default host value. Therefore tilt get just times out.

bkcsfi avatar Oct 27 '22 20:10 bkcsfi