Files
cozystack/hack/e2e-chainsaw/monitoring/monitoring-customconfig-secretref.yaml
T
Aleksei Sviridkin 472f962eff test(e2e): cover monitoring OIDC modes with a Chainsaw suite
Monitoring OIDC lost its live-cluster coverage when the two pre-Chainsaw
BATS suites were removed without a port. Render tests pin each mode on a
fresh install, but not admission by cozystack-api, the Deployment the
Grafana operator builds from the CR, or what an in-place mode change leaves
behind on a running release.

The suite drives one tenant-test Monitoring release through System,
CustomConfig with an inline config, and CustomConfig with a secretRef,
so a single stack bring-up covers all three and the upgrades between
them: the cozy-realm client, scope and client Secret are pruned when
System mode is left, and the inline generic_oauth block is gone once the
secretRef mount arrives.

The monitoring package sources now map to this suite, so a change to
system/monitoring, extra/monitoring, monitoring-rd or grafana-operator
selects it alone instead of escalating to the full run, and the selector
test that relied on cozystack.monitoring reaching no suite seeds a
source that does not.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-10-02 15:03:00 +03:00

47 lines
1.2 KiB
YAML

# Chainsaw applies to an existing object as a JSON merge patch, so a key left
# out of this file keeps the value the inline step gave it. The inline config
# and the users list therefore have to be cleared explicitly: the chart fails
# the render on config together with secretRef (assertCustomConfigXor), and on
# users together with secretRef (assertCustomSecretRefUsersEmpty). null deletes
# the map; an empty map would merge into it and change nothing.
apiVersion: v1
kind: Secret
metadata:
name: mon-oidc-byo-oauth
stringData:
auth.ini: |
[auth.generic_oauth]
enabled = true
name = ByoIdp
client_id = byo-monitoring
client_secret = byo-secret
---
apiVersion: apps.cozystack.io/v1alpha1
kind: Monitoring
metadata:
name: monitoring
spec:
host: ""
metricsStorages:
- name: shortterm
retentionPeriod: "3d"
deduplicationInterval: "15s"
storage: 10Gi
storageClassName: ""
vmagent:
remoteWrite:
urls:
- http://vminsert-shortterm:8480/insert/0/prometheus
logsStorages:
- name: generic
retentionPeriod: "1"
storage: 10Gi
storageClassName: ""
oidc:
mode: CustomConfig
customConfig:
config: null
secretRef:
name: mon-oidc-byo-oauth
users: []