Linter giving error on kubernetes configmap.yaml for an IF-ELSE-IF branch

4/30/2020

My linter giving me error on this yaml, don't see anything wrong with it! Error message:

kubernetes configmap.yaml Reached the end but more keys were found. Please move them above the if / else statements for the parser to function correctly

{{- 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 }}
-- JonB
kubernetes-helm
yaml

0 Answers