Copilot commented on code in PR #2546:
URL:
https://github.com/apache/apisix-ingress-controller/pull/2546#discussion_r2331872901
##########
internal/adc/translator/httproute.go:
##########
@@ -522,16 +556,16 @@ func (t *Translator) TranslateHTTPRoute(tctx
*provider.TranslateContext, httpRou
Weight: weight,
})
- // Set other upstreams in traffic-split
+ // Set other upstreams in traffic-split using
upstream_id
for i, upstream := range upstreams {
weight := apiv2.DefaultWeight
// get weight from the backend refs starting
from the second backend
if i+1 < len(rule.BackendRefs) &&
rule.BackendRefs[i+1].Weight != nil {
weight =
int(*rule.BackendRefs[i+1].Weight)
}
weightedUpstreams = append(weightedUpstreams,
adctypes.TrafficSplitConfigRuleWeightedUpstream{
- Upstream: upstream,
- Weight: weight,
+ UpstreamID: upstream.ID,
Review Comment:
The TrafficSplitConfigRuleWeightedUpstream struct is being used with
UpstreamID field, but the old Upstream field is being replaced. Ensure that the
struct definition has been updated to include UpstreamID field and that the old
Upstream field has been removed to avoid confusion.
##########
api/adc/types.go:
##########
@@ -168,6 +168,7 @@ type Service struct {
StreamRoutes []*StreamRoute `json:"stream_routes,omitempty"
yaml:"stream_routes,omitempty"`
StripPathPrefix *bool `json:"strip_path_prefix,omitempty"
yaml:"strip_path_prefix,omitempty"`
Upstream *Upstream `json:"upstream,omitempty"
yaml:"upstream,omitempty"`
+ Upstreams []*Upstream `json:"upstreams,omitempty"
yaml:"upstreams,omitempty"`
Review Comment:
The new Upstreams field lacks documentation explaining its purpose and
relationship to the existing Upstream field. Consider adding a comment to
clarify when this field is used versus the single Upstream field.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]