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 <xorokhotnikov@gmail.com>
This commit is contained in:
IvanHunters committed 2026-11-17 20:27:41 +03:00
1 parent e88d9085b2
commit c834848043
2 files changed
+17 -1

No files matched your search

@@ -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'
@@ -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]