tilt-dev / tilt-extensions

Extensions for Tilt
https://tilt.dev/
Apache License 2.0
201 stars 159 forks source link

Cert manager does not work on Windows #503

Open nightscape opened 1 year ago

nightscape commented 1 year ago

The following line runs a connection test to Cert Manager in a loop:

local("for i in 1 2 3 4 5 6; do (kubectl apply -f - <<EOF" + cert_manager_test_resources_versioned + "EOF\n) && break || sleep 15; done", quiet=silent, echo_off=silent)

Unfortunately, this doesn't work on Windows where local uses cmd which doesn't support this syntax.

One possible way forward would be to do the looping in Python and write the YAML to a file so that the command works without looping and heredocs. Do you think this would be a good idea? If so, we can create a PR for it.

nicks commented 1 year ago

ya, we'd accept a PR to convert it to python. that's what has ended up happening with a lot of tilt extensions.

tilt also supports local(cmd_bat) for specifying a separate windows batch script, which would be fine too

nightscape commented 1 year ago

We had discovered the cmd_bat, but unfortunately, cmd's restricted feature set makes looping quite ugly, and heredocs don't exist at all. I think using Python for this functionality would keep the code the most readable. One question: Is there a nice built-in way to create a temp file in Tilt? We would have to write the cert_manager_test_resources_versioned somewhere where it doesn't annoy 😉

nicks commented 1 year ago

i usually use mktemp :grimacing:

QuadmanSWE commented 9 months ago

I was annoyed by this for hours, ended up just commenting out the test cert deployment for this to run on windows.

I can't find any documentation on how to run python commands instead of local(), anyone got any pointers? I would love to contribute a PR to fix this for windows.