-
Notifications
You must be signed in to change notification settings - Fork 564
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 'include' function identical to helm's #1345
Comments
@sirianni Hey! I thought the Helmfile way for that has been Just curious, but do you think we'd still need |
You're right, the {{ define "my-template" }}
some-yaml:
foo:
{{ end }}
bar:
{{- tpl "my-template" . | nindent 2 }}
baz:
qux:
{{- tpl "my-template" . | nindent 4 }} |
I think there is still a use for having an It also makes it easier for end-users to use the functions they are already familiar with in Helm, directly in Helmfile. |
@FWest98 Thanks. Yeah I believe this should be super useful if added. The only thing that makes me underprioritize this is that I thought it wasn't trivial to fully make it Helm-compatible. Especially, Helmfile has a bit different semantics in that it doesn't support automatically importing So, do we also need to add some convention or configuration to allow automatically importing .tpl files so that Or can we just add WDYT? |
I believe Helm has the functionality to automatically include all files with an underscore (see here). I think a similar behaviour where helmfile would load all files with underscores in a given directory would be useful. For example, load all files with underscore in helmfile.d, or some other folder to be specified by the user. |
Sounds good! Probably automatic loading of _*.tpl fiiles under the same directory as the target helmfile.yaml, like |
@FWest98 Would you mind submitting a PR for this? |
That idea sounds good as well! Unfortunately, I don't have any experience with Go, so I don't think I would be the person to start implementing this. |
@mumoshu Any desire to see this added still? Happy to take a look in the coming days and submit a PR. |
@naphta Hey. Yeah, I still think this is worth trying! |
This would be an incredibly valuable feature - it would help to reduce complexity greatly, and it would add significant utility to multiple different workflows I - and my colleagues - have designed around I'd pay for this feature. :) |
@armenr please post a feature request in helmfile/helmfile. |
It would be nice to have an
include
function like helm. The use case is to be able to render a template to a string and then further transform it in a pipeline.Without this it is impossible to have a common YAML snippet defined in a template and then indent it contextually based on where it is used. For example:
The text was updated successfully, but these errors were encountered: