mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-21 12:13:55 +09:00
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:
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]
|
||||
|
||||
Reference in new issue
Block a user