Skip to content

Commit

Permalink
Update traffic rule names in fiber config (#290)
Browse files Browse the repository at this point in the history
Co-authored-by: Krithika Sundararajan <[email protected]>
  • Loading branch information
krithika369 and Krithika Sundararajan authored Nov 21, 2022
1 parent 9a04bf1 commit 695bcf2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions api/turing/cluster/servicebuilder/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,8 @@ func buildTrafficSplittingFiberConfig(

// iterate over traffic rules and generated nested routed and
// config for traffic splitting routing strategy
for idx, rule := range rules {
routeID := fmt.Sprintf("traffic-split-%d", idx)
for _, rule := range rules {
routeID := rule.Name

var ruleRoutes models.Routes
for _, rID := range rule.Routes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ routes:
treatment: treatment
type: fiber.DefaultTuringRoutingStrategy
type: EAGER_ROUTER
- id: traffic-split-0
- id: rule-1
routes:
- endpoint: http://example.com/treatment-a
id: treatment-a
Expand Down Expand Up @@ -61,7 +61,7 @@ routes:
treatment: treatment
type: fiber.DefaultTuringRoutingStrategy
type: EAGER_ROUTER
- id: traffic-split-1
- id: rule-2
routes:
- endpoint: http://example.com/treatment-b
id: treatment-b
Expand Down Expand Up @@ -94,7 +94,7 @@ routes:
treatment: treatment
type: fiber.DefaultTuringRoutingStrategy
type: EAGER_ROUTER
- id: traffic-split-2
- id: default-traffic-rule
routes:
- endpoint: http://example.com/control
id: control
Expand Down Expand Up @@ -137,15 +137,15 @@ strategy:
operator: in
values:
- region-a
route_id: traffic-split-0
route_id: rule-1
- conditions:
- field: X-Region
field_source: header
operator: in
values:
- region-b
route_id: traffic-split-1
route_id: rule-2
- conditions: []
route_id: traffic-split-2
route_id: default-traffic-rule
type: fiber.TrafficSplittingStrategy
type: LAZY_ROUTER

0 comments on commit 695bcf2

Please sign in to comment.