Skip to content

Commit e7d5724

Browse files
committed
fix(monitoring-agents): indent extra outputs like the rest
The extra outputs were indented again after the block scalar had been dedented, six columns deeper than the VictoriaLogs outputs, and fluent-bit refuses a config whose indentation is inconsistent, which stops every output, not only the added one. The test now pins the indent instead of matching any whitespace. The credentials and specschema packages join the unit-test target, so their tests run in CI, and the audit-log page names the field the pipeline writes. Assisted-by: LLM Signed-off-by: Timofei Larkin <[email protected]>
1 parent 9a14884 commit e7d5724

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

‎Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ migrations-target-check:
144144
# repo's control (kubebuilder, openapi-gen, etc.) and is better exercised
145145
# from their generator workflows.
146146
go-unit-tests:
147-
go test ./pkg/registry/... ./pkg/config/... ./pkg/cmd/server/...
147+
go test ./pkg/registry/... ./pkg/config/... ./pkg/cmd/server/... ./pkg/credentials/... ./pkg/specschema/...
148148

149149
# The nested Go modules (image sources and the published API types) are
150150
# outside ./... of the root module, so no other target reaches their tests.

‎docs/operations/audit-log.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ In VictoriaLogs, the stream fields of the audit output include `verb` and `user_
5454
objectRef.subresource:mint AND objectRef.resource:credentials
5555
```
5656

57-
The matching record names the Credential in `objectRef.name`, the caller in `user.username`, the impersonated user where Kubernetes impersonation was used, the source address, the response code and the authorization decision. The user is a person only when the dashboard signs in through OIDC; without it, the dashboard acts as the tenant ServiceAccount.
57+
The matching record names the Credential in `objectRef.name`, the caller in `user_username`, the impersonated user where Kubernetes impersonation was used, the source address, the response code and the authorization decision. The user is a person only when the dashboard signs in through OIDC; without it, the dashboard acts as the tenant ServiceAccount.
5858

5959
## Shipping the log to a SIEM
6060

‎packages/system/monitoring-agents/tests/fluent-bit_extra_outputs_test.yaml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ tests:
2828
Host siem.example.org
2929
Port 24224
3030
asserts:
31+
# The added section sits at the indent of the existing ones: sections at
32+
# column 0 and keys at 4 in the ConfigMap value. fluent-bit refuses a
33+
# config whose indentation is inconsistent and then ships no logs at all.
3134
- matchRegex:
3235
path: data["fluent-bit.conf"]
33-
pattern: 'Match audit\.\*\n\s+Host vlinsert-generic\.cozy-monitoring\.svc[\s\S]*\[OUTPUT\]\n\s+Name forward\n\s+Match audit\.\*\n\s+Host siem\.example\.org\n\s+Port 24224'
36+
pattern: '\n\[OUTPUT\]\n Name http\n Match audit\.\*\n'
37+
- matchRegex:
38+
path: data["fluent-bit.conf"]
39+
pattern: '\n\[OUTPUT\]\n Name forward\n Match audit\.\*\n Host siem\.example\.org\n Port 24224\n'

‎packages/system/monitoring-agents/values.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ fluent-bit:
439439
header AccountID 0
440440
header ProjectID 0
441441
{{- with .Values.extraOutputs }}
442-
{{ . | nindent 6 }}
442+
{{ . }}
443443
{{- end }}
444444
{{- range $target, $_ := include "monitoring-agents.tenantLogRoutes" . | fromJson }}
445445
[OUTPUT]

0 commit comments

Comments
 (0)