Skip to content

ScoringEndpoint uses Source.Host instead of Scoring.Host when resolved from synced config #11

Description

@bjoydeep

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

  1. 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
  2. Set configSyncMode: Full so the controller syncs config from the scorer's /config endpoint
  3. 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
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions