temporalio / helm-charts

Temporal Helm charts
MIT License
276 stars 315 forks source link

[Bug] Helm lint fails without sub-charts #510

Closed smktpd closed 3 days ago

smktpd commented 1 week ago

What are you really trying to do?

I am trying to run helm lint after removing sub-charts (as I don't need them)

Describe the bug

[ERROR] templates/: template: temporal/templates/server-job.yaml:46:51: executing "temporal/templates/server-job.yaml" at <include "cassandra.host" $>: error calling include: template: temporal/templates/_helpers.tpl:361:22: executing "cassandra.host" at <include "call-nested" (list . "cassandra" "cassandra.fullname")>: error calling include: template: temporal/templates/_helpers.tpl:69:4: executing "call-nested" at <include $template (dict "Chart" (dict "Name" $subchart) "Values" (index $dot.Values $subchart) "Release" $dot.Release "Capabilities" $dot.Capabilities)>: error calling include: template: no template "cassandra.fullname" associated with template "gotpl"

Error: 1 chart(s) linted, 1 chart(s) failed

Minimal Reproduction

rm -rf charts && helm lint

Additional context

I should be able to use external dependencies (Postgres/Cassandra/ElasticSearch/etc.) and helm lint shouldn't be affected by removing sub-charts for the components I know beforehand I won't be setting up from those sub-charts.

robholland commented 3 days ago

We don't control how helm lint works. I don't believe this is something we can fix.

smktpd commented 3 days ago

But you control _helpers.tpl that currently doesn't have enough 'safety checks' (via ifs or maybe with the help of some fallbacks in values files). IMO this issue is important not only for the sake of sense of correctness by passing lint checks, but that'd also require you to decompose the currently tight connections between manifest templates, values and _helpers.tpl to decouple deployments of the app from its dependent components like cassandra/es/postgres/etc.

robholland commented 3 days ago

The chart does pass lint checks, it just needs the subcharts installed, which is not unreasonable for someone developing the chart.

robholland commented 3 days ago

By installed I mean present.