fix: remove tpl function causing template rendering error#2037
fix: remove tpl function causing template rendering error#2037jerry-shao wants to merge 2 commits intoopen-telemetry:mainfrom
Conversation
The tpl function in _pod.tpl was causing template rendering failures with newer Helm versions due to inability to access Template.Basepath. Replaced with direct toYaml output which achieves the same result.
|
|
|
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
| {{- end }} | ||
|
|
||
| {{- tpl (toYaml $allEnvs) . }} | ||
| {{- toYaml $allEnvs }} |
There was a problem hiding this comment.
I'm no sure removing the tpl call is the way we want to solve this as it'll remove the ability to define env vars with a template. I dont believe tpl is called anywhere higher in this function. What version of helm are you running?
There was a problem hiding this comment.
Problematic version:
> helm version
version.BuildInfo{Version:"v3.13.2", GitCommit:"2a2fb3b98829f1e0be6fb18af2f6599e0f4e8243", GitTreeState:"clean", GoVersion:"go1.21.4"}
Working versions:
> helm version
version.BuildInfo{Version:"v4.1.0", GitCommit:"4553a0a96e5205595079b6757236cc6f969ed1b9", GitTreeState:"clean", GoVersion:"go1.25.6", KubeClientVersion:"v1.35"}
There was a problem hiding this comment.
Are you able to point to a breaking change in helm 4 that is causing the chart not to work on 4.1?
There was a problem hiding this comment.
Additionally, can you confirm the behavior of otel-demo.pod.env with tpl removed? I assume it no longer handles rendering templated env var inputs. That is a feature we need to continue to support
There was a problem hiding this comment.
helm 3.13.2 is the problematic version, the newer version 4.1.0 doesn't have this problem.
Description
Fix template rendering error in OpenTelemetry Demo chart caused by
tplfunction compatibility issues with newer Helm versions.Problem
The chart was failing to deploy with the following error:
Root Cause
The
tplfunction in_pod.tplwas attempting to re-process already-rendered YAML content as a template, which triggered Helm's restriction on accessingTemplate.Basepathwithintplfunctions in newer versions.Solution
Replaced
{{- tpl (toYaml $allEnvs) . }}with{{- toYaml $allEnvs }}in the pod environment template helper.Changes
charts/opentelemetry-demo/templates/_pod.tpltplwrapper aroundtoYamloutputTesting
Type of Change