-
Notifications
You must be signed in to change notification settings - Fork 166
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
Add support for --no-hooks
switch in Helm template
#545
Conversation
Hey! From
With "hook" I guess they mean Chart hooks, which appear to be Kubernetes How would disabling hooks aid in Admission controllers not implementing dry run? |
@sh0rez it helps by not having anything to validate 😄 A problem with hooks implemented as And, like I've mentioned, I don't think this is a problem with tanka but with chart maintainers and charts in general. But it would be helpful to be able to disable those hooks until they're fixed or if you don't really want them running. |
Maybe we can simply hide the resource in jsonnet that is generated by Can you share a minimal reproducible example? I'd like to try it out and see if how it behaves. |
@Duologic yes, you can do that. lokiStack:
helm.template('loki-stack', 'charts/loki-stack', {
namespace: 'monitoring',
NoHooks: true,
values: {}
})
// + {
// 'pod_loki_stack_test': {} //disable the test, otherwise `diff` fails on admission webhooks
// } Overriding that in jsonnet is not a problem but it felt somewhat hacky, which motivated me to submit this PR. |
I would say the jsonnet override is actually a good solution to workaround this. @sh0rez You were more about tying down on |
@sh0rez @Duologic if there we some design decisions behind the current implementation, I was not aware of them. I have no intent on insisting on this feature as there is a decent workaround. If you feel it be better to have a list of arguments instead of strict parameters, I'm more than fine with it can can adjust this PR or close it altogether. |
I have no strong opinion on which direction to choose, I was hoping on some input from @sh0rez when he gets to this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was some confusion on my side, I did not expect helm template
to include Helm hooks, as that makes limited sense to me, given no one is controlling hook rollout, but so be it.
@Duologic as to whether to open the floodgates on any flag – let's see how this goes. If we exceed like 10 flags or so, sure, let's do that instead then.
Thanks both! @sh0rez believe me when I say I was no less confused than you by |
This will allow users disabling hooks when rendering manifests from helm templates.
A use-case is, for example, installing Loki on EKS from https://github.com/grafana/helm-charts/tree/main/charts/loki-stack
When running
tk diff
you'll get an errorThis isn't an issue in Tanka but the scope of this functionality is not limited to it and I think you can very much find use-cases outside of this example.
A potential improvement here could be to allow passing any args to
helm template
maybe using an array without any validation.