yaml - Linter 在 IF-ELSE-IF 分支的 kubernetes configmap.yaml 上给出错误
问题描述
我的 linter 在这个 yaml 上给了我错误,看不出有什么问题!错误信息:
kubernetes configmap.yaml 到了最后但是发现了更多的key。请将它们移到 if / else 语句上方,以便解析器正常运行
{{- if .Values.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: cvn-configmap
namespace: {{ .Release.Namespace }}
data:
# Not documented: CVI_DRYRUN, INSECURE_HTTPS
logLevel: "4"
logSQL: "false"
immigrations: "true"
jobMonitorSeconds: "180"
reclaimJobHours: "0"
sharedVPC: "false"
multiVPC: "0"
bgpWaitMinutes: "0"
maxVRRP: "255"
internalBGP: "169.254.16.0/30"
internalBGPPortChannel: "port-channel1"
rmapBorder: "extcon-rmap-filter"
rmapService: "rmap-bgp-direct"
defaultLagCapacity: "0"
defaultBorderSwitchCapacity: "800"
defaultServiceSwitchCapacity: "800"
gcpEndpointURL: ""
gcpTenantFolderID: ""
gcpRemoteASN: ""
maintenance: "false"
dryrun: "false"
garbageDisposalDays: "1"
garbageDisposalMax: "50"
{{- if eq .Values.global.hyperscaler "aws" }}
bgpWaitMinutes: "5"
defaultLagCapacity: "200"
reclaimJobHours: "36"
{{- else if eq .Values.global.hyperscaler "gcp" }}
defaultLagCapacity: "20"
gcpRemoteASN: "64512"
sharedVPC: "true"
multiVPC: "5"
reclaimJobHours: "6"
{{- end }}
{{- end }}
解决方案
推荐阅读
- python - How to determine the egg of a python package?
- twitter-bootstrap - 如何更改导航栏文字的字体和颜色?
- swift - Local and Network Data Manager
- azure - 如何使用帕洛阿尔托网络 ngf 保护 azure web 应用程序
- oracle - Using Trigger to maintain referential integrity
- javascript - 事件侦听器在 ajax 操作后消失并在刷新后返回
- php - 用于从文件服务器中删除数据的 PHP 脚本
- javascript - 当我有唯一键时,为什么会收到唯一键道具警告?
- azure - ARM resource iteration failing with an empty array
- javascript - Use let variable in different functions