tilt
tilt copied to clipboard
Make it easy to have a button run its command inside a pod
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.
or we could have a kubectl_exec_button extension! more extensions!!! :1st_place_medal:
Interesting thought @nicks 🤔. In this case there is so much overlap that extending it would be more convenient as a user.
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.
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.