style(pkg/envoy/route/route_config): Convert to mapset
Alias deckarep/golang-set with mapset
@@ -4,7 +4,7 @@ import (
"fmt"
"sort"
- set "github.com/deckarep/golang-set"
+ mapset "github.com/deckarep/golang-set"
core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
xds_route "github.com/envoyproxy/go-control-plane/envoy/config/route/v3"
xds_matcher "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3"
@@ -144,7 +144,7 @@ func buildOutboundRoutes(outRoutes []*trafficpolicy.RouteWeightedClusters) []*xd
return routes
}
-func buildRoute(pathMatchTypeType trafficpolicy.PathMatchType, path string, method string, headersMap map[string]string, weightedClusters set.Set, totalWeight int, direction Direction) *xds_route.Route {
+func buildRoute(pathMatchTypeType trafficpolicy.PathMatchType, path string, method string, headersMap map[string]string, weightedClusters mapset.Set, totalWeight int, direction Direction) *xds_route.Route {
route := xds_route.Route{
Match: &xds_route.RouteMatch{
Headers: getHeadersForRoute(method, headersMap),
@@ -181,7 +181,7 @@ func buildRoute(pathMatchTypeType trafficpolicy.PathMatchType, path string, meth
return &route
}
-func buildWeightedCluster(weightedClusters set.Set, totalWeight int, direction Direction) *xds_route.WeightedCluster {
+func buildWeightedCluster(weightedClusters mapset.Set, totalWeight int, direction Direction) *xds_route.WeightedCluster {
var wc xds_route.WeightedCluster
var total int
for clusterInterface := range weightedClusters.Iter() {
