helm-docs
helm-docs copied to clipboard
Fix pre commit hook trigger
This adds regex to trigger pre-commit on files of values-.yaml or values-.yml format.
https://github.com/norwoodj/helm-docs/issues/149
Is the -$ENV
suffix a built-in helm feature? I have never seen this before. Happy to add the ability for the hook to find both yml
and yaml
files, but the -$ENV
suffix seems specific to your use case.
I'm still confused, what's the use-case here? Does helm allow one to specify values-{suffix}.yaml
files?
Yeah it does, in my specific case the structure was something like that
- values-common.yaml
- values-dev.yaml
- values-prod.yaml
where I needed the hook to work on the first ”common” one.
it’s been a year and a half. wow how the time flies.
Right, but this is something you use when you install, no? This tool is intended to document the source of helm charts, the location where they're packaged. What you're describing, to me, sounds like you then install the chart from some other location (or the same repo perhaps, doesn't matter), and you use the values-dev.yaml
and values-prod.yaml
files to customize the chart for two different environments.
Documenting this situation is not what this tool is for. What it sounds to me like you should do is rename values-common.yaml
to values.yaml
. This tool will then happily document the values from that file. Then store the environment-specific values files in some other folder and install the chart with helm install -f values-{env}.yaml path/to/chart
.
Updating the pre-commit hook to accomodate your specific situation, which is not, as far as I can tell, a common helm-supported situation, but rather an implementation detail of how you install your charts, is not something I think we should do.
Am I misunderstanding here?
This can be the case, but for me, the chart was not fetched from somewhere else but packaged locally with values-common.yaml
as the main values.yml
file. Basically breaking the naming conventions in a way.
Maybe ignore this and only add yml/yaml support just to close the issue. :)
I think this should be up to whoever is using the pre-commit hook. Just overriding the file's pattern.
Getting this definition of values, I think the default should be to use only the values.yaml.
Makes sense @norwoodj ?
Makes sense to me. Gonna close this