Skip to content

Commit

Permalink
fix: ApisixRoute backendPoint duplicate (#732) (#734)
Browse files Browse the repository at this point in the history
  • Loading branch information
zlhgo authored Nov 24, 2021
1 parent 9fe7298 commit 703c6b2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/kube/translation/apisix_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ func (t *translator) translateHTTPRouteV2beta1(ctx *TranslateContext, ar *config
weight = *backend.Weight
}
backendPoints := make([]*configv2alpha1.ApisixRouteHTTPBackend, 0)
for _, b := range backends {
backendPoints = append(backendPoints, &b)
for i := range backends {
backendPoints = append(backendPoints, &backends[i])
}
plugin, err := t.translateTrafficSplitPlugin(ctx, ar.Namespace, weight, backendPoints)
if err != nil {
Expand Down Expand Up @@ -395,8 +395,8 @@ func (t *translator) translateHTTPRouteV2beta2(ctx *TranslateContext, ar *config
weight = *backend.Weight
}
backendPoints := make([]*configv2alpha1.ApisixRouteHTTPBackend, 0)
for _, b := range backends {
backendPoints = append(backendPoints, &b)
for i := range backends {
backendPoints = append(backendPoints, &backends[i])
}
plugin, err := t.translateTrafficSplitPlugin(ctx, ar.Namespace, weight, backendPoints)
if err != nil {
Expand Down

0 comments on commit 703c6b2

Please sign in to comment.