Skip to content

Log message for selected clusters in karmada-scheduler is unreadable #6880

@RainbowMango

Description

@RainbowMango

Description

After the refactoring introduced in PR #6597 (which optimized karmada-scheduler performance by using spreadconstraint.ClusterDetailInfo), the log message for "Selected clusters" has become unreadable. This is because the log now directly dumps the slice of ClusterDetailInfo structs, which includes all internal fields (e.g., Name, Score, AvailableReplicas, Cluster, AllocatableReplicas) in a raw, unformatted way.

Current Behavior

The log line prints the full []spreadconstraint.ClusterDetailInfo slice. For example:

Selected clusters: [{member1 100 9 member1 9}]

This output does not clearly map fields to their meanings, making it difficult for developers/operators to quickly parse which clusters were selected and their key attributes (e.g., only cluster name and critical replica values are usually relevant for debugging).

Expected Behavior

The "Selected clusters" log should be human-readable, displaying only key, labeled information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions