Skip to content

Commit

Permalink
fix: ApisixRoute backendPoint duplicate (apache#732) (apache#734)
Browse files Browse the repository at this point in the history
  • Loading branch information
zlhgo authored and Sindweller committed Nov 25, 2021
1 parent 4c70573 commit 3cfa4e4
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 3cfa4e4

Please sign in to comment.