Open krancour opened 8 years ago
I'm gonna guess that whatever gets generated also has helm:generate
in the headers
Shouldn't helm generate
only be looking in the tpl
dir for templates? If the generated manifests still mentioned helm:generate
(albeit in a comment), shouldn't those be ignored? I'm probably misunderstanding something. fwiw, this is with the official deis-dev
chart, so the issue should be easily reproducable.
Maybe the generated files shouldn't contain the helm:generate
line?
We don't strip anything out of a file because we don't want to presume intent.
Is this still a problem somewhere? I'd like to take a look.
Alright, so I reproduced the problem with the deis-dev
chart.
The reason it is happening is because the helm:generate
header is inside of a manifest file, and that file operates on itself as input.
There are two design decisions that we made that are resulting in this problem. Both decisions were made intentionally, but I'd be open to reconsidering.
helm generate
operates on an entire chart, including the directory manifests
. While we don't recommend people store templates in manifests, we don't prevent the generator from checking that directory. We could do this.helm generate
itself NEVER modifies a file. So it will not strip a generate header from output, or do any other modification. And the template engine doesn't remove helm:generate
headers. While we could change this behavior, I'm not all that keen on this.Thoughts?
I thought requiring templates to live only in tpl/
(and ignoring them in manifests/
) is too much magical behavior. At least I wouldn't expect it.
Stripping the helm:generate
header seemed reasonable to me. Or you could rewrite it as helm:generated
and otherwise keep it intact. The problem is obviously when there's a template actually in the destination manifests/
directory, then helm:generate
would only work once under this proposal, and you'd have to "reset" the templates by editing them to say helm:generate
again...ugly.
I guess on balance solution 1. seems saner. Or there's:
If we leave it as is, it remains a head scratching moment for anyone who just wants to regenerate secrets and such on the chart they already have (meaning no update) to bootstrap a second cluster or replacement cluster.
Or... we could use the --exclude
flag that's been in there the whole time, but which I forgot about.
$ helm generate --exclude=manifests
I'm not sure I understand why this happens: