-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Description
The ServiceMonitor template in the azure-resourcemanager-exporter chart produces invalid YAML when prometheus.monitor.enabled is set to true.
Root Cause
In templates/prometheus/servicemonitor.yaml, line 8:
labels: {{ include "azure-resourcemanager-exporter.labels" . | indent 4 }}This uses indent 4 instead of nindent 4. Since indent does not prepend a newline, the labels output is placed on the same line as labels:, producing:
labels: helm.sh/chart: azure-resourcemanager-exporter-1.3.6This is invalid YAML — helm.sh/chart: is interpreted as a nested mapping key within the labels scalar value, causing:
Error: YAML parse error on azure-resourcemanager-exporter/templates/prometheus/servicemonitor.yaml:
error converting YAML to JSON: yaml: line 6: mapping values are not allowed in this context
Affected Versions
All versions from 1.0.0 through 1.3.6 (latest). The bug has never been caught because prometheus.monitor.enabled defaults to false.
Fix
Change indent to nindent on line 8 of templates/prometheus/servicemonitor.yaml:
- labels: {{ include "azure-resourcemanager-exporter.labels" . | indent 4 }}
+ labels:
+ {{- include "azure-resourcemanager-exporter.labels" . | nindent 4 }}Steps to Reproduce
- Set
prometheus.monitor.enabled: truein values - Run
helm template . - Observe YAML parse error on the ServiceMonitor
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels