Files
cozystack/packages/system/monitoring/tests/vlogs_datasource_documents_test.yaml
T
Alexey Artamonov 30fcfe6877 fix(monitoring): emit each vlogs GrafanaDatasource as its own document
The range over logsStorages emitted its documents with no `---` separator, so
two or more entries concatenated into a single document with duplicate keys,
each later entry overwrote the earlier one, and every log store but the last
silently got no datasource. Add the separator inside the range, matching the
traces datasource template.

Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
Assisted-by: LLM
2026-09-24 12:09:09 +03:00

36 lines
1.1 KiB
YAML

suite: vlogs GrafanaDatasource is one document per logsStorages entry
templates:
- templates/vlogs/grafana-datasource.yaml
release:
name: monitoring
namespace: tenant-root
# The range emits one GrafanaDatasource per logsStorages entry. Without a `---`
# separator inside the range two entries concatenate into a single document with
# duplicate keys, the later entry overwrites the earlier one, and every log store
# but the last gets no datasource. These cases pin that each entry is its own
# document.
tests:
- it: renders one datasource for the default single-entry logsStorages
asserts:
- hasDocuments:
count: 1
- containsDocument:
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDatasource
name: vlogs-generic
- it: renders a separate datasource document per logsStorages entry
set:
logsStorages:
- name: generic
retentionPeriod: "1"
storage: 10Gi
- name: audit
retentionPeriod: "7"
storage: 10Gi
asserts:
- hasDocuments:
count: 2