Closed ProfMoo closed 2 years ago
So if I understand correctly, you are defining named templates containing your ports and including those around your chart. The problem seems to be, that named templates are defined in .tpl
files by convention, so the code only scans those for define
blocks (see here).
The quick and simple fix for your case would be to rename your _ports.yaml
to _ports.tpl
if possible.
The extension is definitely making an incorrect assumption here though, which we should fix. @tim-koehler were there any reasons for limiting the scanning of define
blocks to .tpl
files?
@marcfrederick Thanks for the info. I tried changing the file from _ports.yaml
to _ports.tpl
and the plugin worked as expected :).
So yes, I agree that the extension is making an incorrect assumption, but I also think that the workaround is totally permissible. Happy to either keep open or close the issue.
@ProfMoo
Just merged and released a new patch which also allows templates to also be found in non .tpl
files (like .yaml
). This should finally resolve your issue 😊
@marcfrederick Thanks for your PR
Awesome, thanks for the quick response everyone!
Hi! Very nice plugin!
One issue I'm running into is the plugin being able to find
define
blocks from other YAML files. For example, let's say I have two files:_ports.yaml
where Idefine
port constants that are used across the chart, like{{- define "my.port" -}}
.stateful-set.yaml
, which uses{{ include "my.port" }}
to get the port value from_ports.yaml
.The practice is a bit unusual, but it works perfectly well in Helm and passes Helm linting checks. As such, I believe it should work this plugin.
Looking forward to further thoughts on this use-case.