fix(authservice): guard sso chain auto-inject so user defined chains win
General MR
Summary
The umbrella unconditionally auto-injects prometheus, alertmanager, and thanos entries into the rendered authservice chains map whenever monitoring.sso.enabled (prometheus/alertmanager) or addons.thanos.sso.enabled (thanos) is true. When a user also defines one of those names under addons.authservice.chains, both entries are written to the same rendered values document under the same key. Helm's YAML parser collapses the duplicate to last-write-wins, so the auto-injected entry silently overrides the user's, with no warning and no per-chain opt-out.
This change wraps each auto-inject block in a hasKey guard so a user-defined chain of the same name suppresses only that auto-inject and wins:
{{- if not (hasKey (.Values.addons.authservice.chains | default dict) "prometheus") }}thanos takes the clause inline on its existing guard. prometheus and alertmanager share the outer monitoring.enabled/monitoring.sso.enabled guard, so each gets its own independent inner guard, which means defining only one of them does not suppress the other. The batteries-included default is unchanged: users who define none of the three names still get all three auto-injected. No values schema change.
Adds chart/unittests/packages/authservice/chain-collision_test.yaml (authservice/values.yaml previously had no template-level unit coverage). Four cases: no user chains (all three auto-inject), and one per reserved name where the user chain wins while the other two still auto-inject.
Relevant logs/screenshots
helm template of the umbrella with a user-defined prometheus chain (client_id: my-prometheus) renders the user's chain while alertmanager and thanos still auto-inject:
prometheus:
client_id: my-prometheus
alertmanager:
client_id: <monitoring.sso.alertmanager.client_id> # auto-inject intact
thanos:
client_id: <addons.thanos.sso.client_id> # auto-inject intactThe new unit suite passes against the fix and fails without it (the three collision cases fail when the guard is removed, the no-collision baseline still passes), confirming the tests assert behavior rather than just rendering:
PASS Package - Authservice - Chain Collision
Tests: 4 passed, 4 totalLinked Issue
Closes #3311 (closed)
Upgrade Notices
Behavior change for users who define addons.authservice.chains.prometheus, .alertmanager, or .thanos while the corresponding SSO auto-inject is enabled. Previously their definition was silently dropped in favor of the auto-injected chain; it now renders and takes precedence. Users who do not set those reserved names see no change. No action required to retain existing behavior.