Patch the Grafana CR so that the oidc.mode selector drives the actual
Grafana runtime config:
- mode: System — emit a full auth.generic_oauth section under
spec.config with client_id / client_secret / auth_url / token_url /
api_url / scopes / role_attribute_path / allow_assign_grafana_admin
built from the helpers, and inject
GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET as an env from the persistent
Secret introduced in the previous commit. role_attribute_path maps
membership in the per-instance -admin / -editor / -viewer groups to
Grafana's Admin / Editor / Viewer roles, defaulting to Viewer on
authenticated identities with none of them.
allow_assign_grafana_admin is set to true only for the platform
release (Release.Name == 'monitoring-system'); tenant Grafana stays
at org-level Admin.
- mode: CustomConfig (inline) — pass the operator-supplied config map
verbatim to spec.config.auth.generic_oauth. `cozy` is not in the
path.
- mode: CustomConfig (secretRef) — mount the operator-managed Secret
under /etc/grafana/oidc and load it via GF_PATHS_CUSTOM_INI. The
ini fragment is authoritative; the chart does not emit
auth.generic_oauth under spec.config in this branch.
- mode: None (default) — no change to the rendered manifests.
CustomConfig branch fails the render at the XOR helper if both or
neither of `config` / `secretRef.name` are set. `disable_login_form`
stays false so the admin_user/admin_password Secret remains a
documented break-glass path in every mode.
Signed-off-by: Ivan Okhotnikov <ivan.okhotnikov@aenix.io>