tilt-dev / tilt-extensions

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

Validate flag for helm_remote extension #504

Closed mhmxs closed 1 year ago

mhmxs commented 1 year ago

I have found an issue with one of our Helm charts.

Error: chart requires kubeVersion: >=1.21.0-0 which is incompatible with Kubernetes v1.20.0\n\nUse --debug flag to render out invalid YAML

My Kubernetes version is 1.25.3, so I suspected helm. Here is the solution: https://github.com/helm/helm/issues/10086#issuecomment-909595139

But the case is Tilt built in helm function doesn't support validate flag, so this change uses a custom template command which optionally validate-able.

nicks commented 1 year ago

This had to be rolled back because it broke namespace injection. https://github.com/tilt-dev/tilt-extensions/issues/506.

Sorry, I should have caught this. The helm() built-in does its own namespace injection because helm template does not. There's a longer history on this here: https://github.com/helm/helm/issues/5465

i think the best way to move this forward is to add the validate argument to the built-in helm() function. would you be willing to put together a pr for that?

mhmxs commented 1 year ago

@nicks Thanks to catch the problem :) Does it make sense to reopen the PR with an appended namespace?

yaml = local(namespace + build_helm_command(helm_tpl_cmd, None, None))