mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 04:06:34 +09:00
## What this PR does
The tenant Kubernetes application checked fluent-bit `extraOutputs` with
a regular expression over the text of an `outputs` override, written
against the exact layout of the default hook. The monitoring-agents
chart decides the same question by rendering `outputs`, so a hook
written with `{{- if .Values.config.extraOutputs }}` / `{{
.Values.config.extraOutputs }}` / `{{- end }}`, or a bare `{{
.Values.config.extraOutputs }}`, was refused by the application although
monitoring-agents renders it into `fluent-bit.conf`. I confirmed this
with `helm template` on both charts.
I kept a check in the application, because the addon fails in a
HelmRelease the tenant cannot read and the Application status reflects
only its own release. It now only requires `outputs` to mention
`.Values.config.extraOutputs`. The check stays textual because executing
a tenant template in this chart would run it in the management cluster,
and the exact check is already made by the monitoring-agents render
guard.
A new test covers the `if` form. The application tests for a
commented-out or newline-trimming hook are removed, since only the
monitoring-agents guard catches those now, and it already has tests for
both.
Follow-up to #5376.
### Screenshots
Not a UI change.
### Downstream repositories
- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:
### Release note
```release-note
fix(kubernetes): an `addons.monitoringAgents.valuesOverride` that overrides fluent-bit `outputs` and emits `extraOutputs` with an `if` block or a bare `{{ .Values.config.extraOutputs }}` is no longer refused by the application.
```
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Monitoring-agent output configuration now accepts a wider range of
template formats when including extra destinations, including
conditional hooks. Validation still requires the configuration to
reference the extra destinations setting.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
How to test packages local
cd packages/core/installer
make image-cozystack REGISTRY=YOUR_CUSTOM_REGISTRY
make apply
kubectl delete po -l app=source-controller -n cozy-fluxcd