]> git.feebdaed.xyz Git - 0xmirror/grpc-go.git/commit
xds: Store WeightedClusters as a slice instead of a map inside the Route (#8632)
authorEaswar Swaminathan <easwars@google.com>
Wed, 8 Oct 2025 18:20:00 +0000 (11:20 -0700)
committerGitHub <noreply@github.com>
Wed, 8 Oct 2025 18:20:00 +0000 (11:20 -0700)
commit20c9f65ac25f1f14330e8403e4c101b5a20abbda
tree2fc7e3fe537fcb3c5b7085b07fe230433318bcc5
parent9ff80a7f245ceb2aad36ef6987f34c9441dbd43e
xds: Store WeightedClusters as a slice instead of a map inside the Route (#8632)

Reasons for this change:
- The `WeightedClusters` field is never used as a map.
- Weighted clusters are stored as a list in the original envoy proto as
well.
- In tests that require deterministic WRR behavior, we use the
`testutils.NewTestWRR` to get rid of the randomness. But the output
still depends on the order in which items are added to the WRR. Maps in
Go are non-deterministic.

RELEASE NOTES: N/A
internal/xds/resolver/xds_resolver.go
internal/xds/xdsclient/tests/federation_watchers_test.go
internal/xds/xdsclient/tests/rds_watchers_test.go
internal/xds/xdsclient/tests/resource_update_test.go
internal/xds/xdsclient/xdsresource/type_rds.go
internal/xds/xdsclient/xdsresource/unmarshal_lds_test.go
internal/xds/xdsclient/xdsresource/unmarshal_rds.go
internal/xds/xdsclient/xdsresource/unmarshal_rds_test.go