@@ -83,9 +83,10 @@ func (rwc *RouteWeightedClusters) TotalClustersWeight() int {
83
83
return totalWeight
84
84
}
85
85
86
- // AddRoute adds a route to an OutboundTrafficPolicy given an HTTP route match and weighted cluster. If a Route with the given HTTP route match
87
- // already exists, an error will be returned. If a Route with the given HTTP route match does not exist,
88
- // a Route with the given HTTP route match and weighted clusters will be added to the Routes on the OutboundTrafficPolicy
86
+ // AddRoute adds a route to an OutboundTrafficPolicy given an HTTP route match and weighted cluster.
87
+ // If a Route with the given HTTP route match already exists, an error will be returned.
88
+ // If a Route with the given HTTP route match does not exist,
89
+ // a Route with the given HTTP route match and weighted clusters will be added to the Routes on the OutboundTrafficPolicy
89
90
func (out * OutboundTrafficPolicy ) AddRoute (httpRouteMatch HTTPRouteMatch , retryPolicy * policyv1alpha1.RetryPolicySpec , weightedClusters ... service.WeightedCluster ) error {
90
91
wc := mapset .NewSet ()
91
92
for _ , c := range weightedClusters {
@@ -137,7 +138,7 @@ func MergeInboundPolicies(original []*InboundTrafficPolicy, latest ...*InboundTr
137
138
}
138
139
139
140
// MergeRules merges the give slices of rules such that there is one Rule for a Route with all allowed service accounts listed in the
140
- // returned slice of rules
141
+ // returned slice of rules
141
142
func MergeRules (originalRules , latestRules []* Rule ) []* Rule {
142
143
for _ , latest := range latestRules {
143
144
foundRoute := false
@@ -156,8 +157,8 @@ func MergeRules(originalRules, latestRules []*Rule) []*Rule {
156
157
}
157
158
158
159
// mergeRoutesWeightedClusters merges two slices of RouteWeightedClusters and returns a slice where there is one RouteWeightedCluster
159
- // for any HTTPRouteMatch. Where there is an overlap in HTTPRouteMatch between the originalRoutes and latestRoutes, the WeightedClusters
160
- // will be unioned as there can only be one set of WeightedClusters per HTTPRouteMatch.
160
+ // for any HTTPRouteMatch. Where there is an overlap in HTTPRouteMatch between the originalRoutes and latestRoutes, the WeightedClusters
161
+ // will be unioned as there can only be one set of WeightedClusters per HTTPRouteMatch.
161
162
func mergeRoutesWeightedClusters (originalRoutes , latestRoutes []* RouteWeightedClusters ) []* RouteWeightedClusters {
162
163
for _ , latest := range latestRoutes {
163
164
foundRoute := false
0 commit comments