From b81faa0af76ffbaf97591fdbd7e848fa0bf995e3 Mon Sep 17 00:00:00 2001 From: Sebastian Rakel Date: Mon, 18 Jun 2018 23:19:07 +0200 Subject: [PATCH] Remove double quotes from source_labels value with gsub The value in source_labels have to be without quotes, but sometimes you have to use brackets in the value and puppet surrounds it with double quotes. So we need to replace the double quotes with nothing in the template --- templates/prometheus.yaml.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/prometheus.yaml.erb b/templates/prometheus.yaml.erb index b59941aa7..483c475ee 100644 --- a/templates/prometheus.yaml.erb +++ b/templates/prometheus.yaml.erb @@ -22,7 +22,7 @@ if @prometheus_v2 end -%> <%= if @prometheus_v2 -full_config.to_yaml +full_config.to_yaml().gsub(/source_labels: ".+?"/) { |x| x.gsub('"', '') } else full_config.to_yaml(options = {:line_width => -1}).gsub(/source_labels: ".+?"/) { |x| x.gsub('"', '') } end