Skip to content

Commit cf74322

Browse files
lllamnypIvanHunters
authored andcommitted
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 08a9161 commit cf74322

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
@@ -145,7 +145,7 @@ migrations-target-check:
145145
# repo's control (kubebuilder, openapi-gen, etc.) and is better exercised
146146
# from their generator workflows.
147147
go-unit-tests:
148-
go test ./pkg/registry/... ./pkg/config/... ./pkg/cmd/server/...
148+
go test ./pkg/registry/... ./pkg/config/... ./pkg/cmd/server/... ./pkg/credentials/... ./pkg/specschema/...
149149

150150
# The nested Go modules (image sources and the published API types) are
151151
# 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
@@ -445,7 +445,7 @@ fluent-bit:
445445
header AccountID 0
446446
header ProjectID 0
447447
{{- with .Values.extraOutputs }}
448-
{{ . | nindent 6 }}
448+
{{ . }}
449449
{{- end }}
450450
{{- range $target, $_ := include "monitoring-agents.tenantLogRoutes" . | fromJson }}
451451
[OUTPUT]

0 commit comments

Comments
 (0)