Description
In internal/controller/dynamicscoringconfig_controller.go, line 474 correctly checks LastSyncedConfig.Scoring.Host, but line 475 assigns Source.Host instead of Scoring.Host.
The DynamicScorer CRD defines these as distinct fields:
- Source.Host — the host the agent queries for data (e.g., Prometheus)
- Scoring.Host — the host the agent calls to score that data (e.g., the scorer API)
Steps to Reproduce
- Create a DynamicScorer CR where Source.Host and Scoring.Host differ — e.g., the agent queries local Prometheus for data but sends it to a scorer hosted on the hub
- Set configSyncMode: Full so the controller syncs config from the scorer's /config endpoint
- The resulting ConfigMap on the managed cluster contains Source.Host as the scoring endpoint instead of Scoring.Host — the controller copies the wrong field on line 475
- The agent receives the wrong endpoint and all scoring requests fail
Impact
Currently masked when Source.Host and Scoring.Host happen to be the same (common in simple setups), or when configSyncMode: None is used. Becomes a problem when the scorer runs on a different host than the data source.
Suggested Fix
Line 475 — change:
scoringHost = scorer.Status.LastSyncedConfig.Source.Host
to:
scoringHost = scorer.Status.LastSyncedConfig.Scoring.Host
Description
In internal/controller/dynamicscoringconfig_controller.go, line 474 correctly checks LastSyncedConfig.Scoring.Host, but line 475 assigns Source.Host instead of Scoring.Host.
The DynamicScorer CRD defines these as distinct fields:
Steps to Reproduce
Impact
Currently masked when Source.Host and Scoring.Host happen to be the same (common in simple setups), or when configSyncMode: None is used. Becomes a problem when the scorer runs on a different host than the data source.
Suggested Fix
Line 475 — change:
scoringHost = scorer.Status.LastSyncedConfig.Source.Host
to:
scoringHost = scorer.Status.LastSyncedConfig.Scoring.Host