Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Conversation

chrissgyulev
Copy link
Contributor

@chrissgyulev chrissgyulev commented Apr 9, 2023

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
  1. 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:

Checklist

  • Code meets the Developer Guide
  • User guide and development docs updated (if needed)
  • Related Helm chart(s) updated (if needed)

@sagikazarmark sagikazarmark merged commit 2c6aec9 into banzaicloud:master Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants