From c83484804341cdcc1d1e56d08cc0cc723f29181a Mon Sep 17 00:00:00 2001 From: IvanHunters Date: Tue, 17 Nov 2026 16:10:33 +0300 Subject: [PATCH] fix(monitoring-agents): render extraOutputs through tpl A SIEM output added to extraOutputs is spliced into config.outputs, which the ConfigMap renders with tpl once, so a template expression inside the appended value, such as the Release.Namespace that the comment's own example uses, reached fluent-bit.conf verbatim and the destination resolved to a literal. Render the value with tpl and the subchart root so the documented expressions resolve. Assisted-by: LLM Signed-off-by: IvanHunters --- .../tests/fluent-bit_extra_outputs_test.yaml | 16 ++++++++++++++++ packages/system/monitoring-agents/values.yaml | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/system/monitoring-agents/tests/fluent-bit_extra_outputs_test.yaml b/packages/system/monitoring-agents/tests/fluent-bit_extra_outputs_test.yaml index 3c3fd7580..63c1910de 100644 --- a/packages/system/monitoring-agents/tests/fluent-bit_extra_outputs_test.yaml +++ b/packages/system/monitoring-agents/tests/fluent-bit_extra_outputs_test.yaml @@ -37,3 +37,19 @@ tests: - matchRegex: path: data["fluent-bit.conf"] pattern: '\n\[OUTPUT\]\n Name forward\n Match audit\.\*\n Host siem\.example\.org\n Port 24224\n' + + - it: renders template expressions in extraOutputs with the subchart context + set: + fluent-bit: + extraOutputs: | + [OUTPUT] + Name forward + Match audit.* + Host siem.{{ .Release.Namespace }}.svc + asserts: + - matchRegex: + path: data["fluent-bit.conf"] + pattern: '\n Host siem\.cozy-monitoring\.svc\n' + - notMatchRegex: + path: data["fluent-bit.conf"] + pattern: 'Release\.Namespace' diff --git a/packages/system/monitoring-agents/values.yaml b/packages/system/monitoring-agents/values.yaml index fb7f8f843..a3757a2a4 100644 --- a/packages/system/monitoring-agents/values.yaml +++ b/packages/system/monitoring-agents/values.yaml @@ -445,7 +445,7 @@ fluent-bit: header AccountID 0 header ProjectID 0 {{- with .Values.extraOutputs }} - {{ . }} + {{ tpl . $ }} {{- end }} {{- range $target, $_ := include "monitoring-agents.tenantLogRoutes" . | fromJson }} [OUTPUT]