Skip to content

Commit

Permalink
fix: panic when using nil xdsRouteAction (envoyproxy#2104)
Browse files Browse the repository at this point in the history
Signed-off-by: bitliu <bitliu@tencent.com>
(cherry picked from commit 77445de)
Signed-off-by: Arko Dasgupta <arko@tetrate.io>
  • Loading branch information
Xunzhuo authored and arkodg committed Nov 1, 2023
1 parent 986653d commit 17cb488
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/xds/translator/ratelimit.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (t *Translator) buildRateLimitFilter(irListener *ir.HTTPListener) *hcmv3.Ht
// patchRouteWithRateLimit builds rate limit actions and appends to the route.
func patchRouteWithRateLimit(xdsRouteAction *routev3.RouteAction, irRoute *ir.HTTPRoute) error { //nolint:unparam
// Return early if no rate limit config exists.
if irRoute.RateLimit == nil || irRoute.RateLimit.Global == nil {
if irRoute.RateLimit == nil || irRoute.RateLimit.Global == nil || xdsRouteAction == nil {
return nil
}

Expand Down

0 comments on commit 17cb488

Please sign in to comment.