From 5d32e84e0c504e57594457a946d495f83ad80697 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Wed, 30 Oct 2024 08:45:59 +0100 Subject: [PATCH] cleaner proxy url injection into userdata --- internal/helper/loadbalancermachine.go | 5 +++-- internal/helper/loadbalancermachine_test.go | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/helper/loadbalancermachine.go b/internal/helper/loadbalancermachine.go index 5694706b..0532e49d 100644 --- a/internal/helper/loadbalancermachine.go +++ b/internal/helper/loadbalancermachine.go @@ -489,7 +489,7 @@ func generatePromtailConfig( proxy := "" if logForward.ProxyURL != "" { - proxy = "\n proxy_url: '" + logForward.ProxyURL + "'" + proxy = " proxy_url: '" + logForward.ProxyURL + "'" } return `server: @@ -499,7 +499,8 @@ positions: filename: /tmp/positions.yaml clients: - - url: '` + logForward.LokiURL + "'" + proxy + ` + - url: '` + logForward.LokiURL + `' +` + proxy + ` scrape_configs: - job_name: messages diff --git a/internal/helper/loadbalancermachine_test.go b/internal/helper/loadbalancermachine_test.go index 31de0216..ac28050c 100644 --- a/internal/helper/loadbalancermachine_test.go +++ b/internal/helper/loadbalancermachine_test.go @@ -35,6 +35,7 @@ positions: clients: - url: 'localhost' + scrape_configs: - job_name: messages static_configs: