Mik*_*ike 6 go-templates kubernetes-helm
我正在尝试执行以下操作:
{{- $cassandrafullname := template "cassandra.fullname" . -}}
Run Code Online (Sandbox Code Playgroud)
但我在试运行时遇到此错误:
Error: UPGRADE FAILED: parse error in "cassandra/templates/service.yaml": template: cassandra/templates/service.yaml:1: unexpected <template> in command
Run Code Online (Sandbox Code Playgroud)
我有这个问题的原因是因为我无法template cassandra.fullname在范围内使用,所以我试图将该值放入一个变量中并在该范围内使用它。所以如果有一个解决方案,它也会被接受!
Dav*_*aze 12
Helm 定义了一个include与标准相同的函数template,除了它返回渲染的输出而不是输出它。你应该能够写
{{- $cassandrafullname := include "cassandra.fullname" . -}}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6746 次 |
| 最近记录: |