【发布时间】:2019-06-13 14:34:21
【问题描述】:
我在检查 helm 项目时遇到此错误
$ helm lint --debug
==> Linting .
[INFO] Chart.yaml: icon is recommended
[ERROR] templates/: render error in "myProject/templates/configmap.yaml": template: myProject/templates/configmap.yaml:26:27: executing "myProject/templates/configmap.yaml" at <.Values.fileServiceH...>: can't evaluate field fileHost in type interface {}
Error: 1 chart(s) linted, 1 chart(s) failed
这是我的configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: myProject-configmap
data:
tkn.yaml: |
iss: "{{ .Values.iss }}"
aud: "{{ .Values.aud }}"
db.yaml: |
database: "{{ .Values.database }}"
user: "{{ .Values.user }}"
host: "{{ .Values.host }}"
dialect: "{{ .Values.dialect }}"
pool:
min: "{{ .Values.pool.min }}"
max: "{{ .Values.pool.max }}"
acquire: "{{ .Values.pool.acquire }}"
idle: "{{ .Values.pool.idle }}"
fileservice.yaml: |
fileServiceHost:
fileHost: "{{ .Values.fileServiceHost.fileHost }}"
notificationservice.yaml: |
notificationServiceHost:
notificationHost: "{{ .Values.notificationservice.notificationHost }}"
organizationservice.yaml: |
organizationServiceHost:
organizationHost: "{{ .Values.organizationservice.organizationHost }}"
organizations.yaml: |
organizations: {{ .Values.organizations | toJson | indent 4 }}
epic.yaml: |
redirectUri: "{{ .Values.redirectUri }}"
这是我的/vars/dev/fileservice.yaml 文件
fileServiceHost:
fileHost: 'https://example.com'
我收到此 lint 错误是怎么回事?
【问题讨论】:
-
您已经说过您的 fileservice.yaml 文件包含什么,但您的 values.yaml 中有什么?该错误表明您在图表的 values.yaml 中没有 fileHost 的值。如果你认为你这样做了,那么请仔细检查它的缩进和语法。
-
我是否必须在
values.yaml中拥有与我在/vars/文件中覆盖的相同的 yaml 结构?
标签: kubernetes kubernetes-helm