Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Have k8s_custom_deploy output be the stdout of the apply command #6477

Open
rrmistry opened this issue Dec 12, 2024 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@rrmistry
Copy link

rrmistry commented Dec 12, 2024

Describe the Feature You Want

Return the stdout from the apply command/bat of k8s_custom_deploy as the function output in Tiltfile.

Current Behavior

The k8s_custom_deploy function returns nothing.

Why Do You Want This?

I was previously using the local(...) + k8s_yaml(...) pattern to run timoni to deploy Kubernetes resources.

This was helpful because I could simultaneously parse out the output of local(...) and group resources the way I like in the Tilt WebUI using k8s_resource.

This however used the timoni build command that generates the YAML manifests (similar to helm template ... command).

timoni also allows us to apply resources in specific orders and with Kubernetes unit testing. This is a significant quality-of-life improvement over helm.

The issue is that if we use timoni to apply resources and use Tilt's k8s_custom_deploy function then we lose the ability to parse the YAML of the applied objects and pass that into k8s_resource function. There was no way that I could find to get the stdout from k8s_custom_deploy apply command.

Having k8s_custom_deploy output the apply command feels like the easiest fix around this problem. But am open to suggestions or workarounds.

Additional context
In case you try to reproduce this with timoni, note that timoni apply does not output YAML manifests as expected by Tilt's k8s_custom_deploy. It has its own console output format. So I used a wrapper script around timoni apply + timoni inspect resources when using in k8s_custom_deploy. This script is shown in stefanprodan/timoni#454

@rrmistry rrmistry added the enhancement New feature or request label Dec 12, 2024
@rrmistry rrmistry changed the title [Feature] Have k8s_custom_deploy output be the stdout of the command that ran for apply [Feature] Have k8s_custom_deploy output be the stdout of the apply command Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant