Getting this error “error converting YAML to JSON: yaml: line 11: did not find expected ‘-‘ indicator”
attaching part of the code and line11 is {{ else }}
can someone please tell me what I’m missing here?
values.yaml
plugins:
- name: prometheus
tags: amp
instance_Name: stg
metrics: true
- name: file-log
tags: amp
instance_Name: stg
custom_fields_by_lua: true
template.yaml
_format_version: "3.0"
plugins:
{{- range $plugin := .Values.plugins }}
{{ if $plugin.custom_fields_by_lua }}
- config:
custom_fields_by_lua: []
path: /dev/stdout
reopen: {{ $plugin.custom_fields_by_lua }}
{{ else }}
- config:
bandwidth_metrics: {{ $plugin.metrics }}
latency_metrics: {{ $plugin.metrics }}
per_consumer: {{ $plugin.metrics}}
status_code_metrics: {{ $plugin.metrics}}
upstream_health_metrics: {{ $plugin.metrics }}
{{ end }}
enabled: true
name: {{ $plugin.name }}
protocols:
- grpc
- grpcs
- http
- https
tags:
- {{ $plugin.tags }}
{{- end }}