我无法从命名模板部分的values.yaml中获取值,但在该部分之外可用。
如果有人能弄清楚出什么问题,我将不胜感激。
头盔2和头盔3具有相同的行为。
简单示例模板/test.yaml
{{- define "test" -}}
# Inside define section: {{ .Values.env }}
{{- end -}}
{{ template "test"}}
---
# Outside define section: {{ .Values.env}}
values.yaml
env: env-placeholder
输出
> helm template .
---
# Source: helm-configs-template/templates/test.yaml
# Inside define section:
---
# Source: helm-configs-template/templates/test.yaml
# Outside define section: env-placeholder
我已经找到了解决我问题的方法。我忘了在[>]上加点
{{ template "test" .}}