banzaicloud / banzai-charts

Curated list of Banzai Cloud Helm charts used by the Pipeline Platform
Apache License 2.0
368 stars 284 forks source link

[cadence] - fix relabelling block in Prometheus Operator's ServiceMonitor template #1339

Closed chrissgyulev closed 1 year ago

chrissgyulev commented 1 year ago
Q A
Bug fix? yes
New feature? no
API breaks? no
Deprecations? no
Related tickets no
License Apache 2.0

What's in this PR?

Add a missing newline to Prometheus Operator's ServiceMonitor template

Why?

ServiceMonitor template was producing invalid yaml output, because of missing newline. This case only pops-up when you try to use relabelling. nindent is used instead of indent to fix the issue.

Additional context

The issue can be reproduced and tested with the following commands:

  1. first go to cadence folder and build Helm deps
    cd cadence
    helm dependency build
  2. Then try to use relabelling:
    
    #!/bin/bash

helm template \ --set server.metrics.serviceMonitor.enabled=true \ --set server.metrics.serviceMonitor.relabellings[0].sourceLabels={address} \ --set server.metrics.serviceMonitor.relabellings[0].targetLabel=new_label \ --set server.metrics.serviceMonitor.relabellings[0].replacement=new-value \ cadence . | grep ServiceMonitor -A20



Related resources:
- https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
- https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#relabelconfig

### Checklist
<!-- Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields. -->

- [x] Code meets the [Developer Guide](https://github.com/banzaicloud/developer-guide)
- [x] User guide and development docs updated (if needed)
- [x] Related Helm chart(s) updated (if needed)