fix: use upstream id instead of inline upstream in traffic-split plugin#2546
fix: use upstream id instead of inline upstream in traffic-split plugin#2546
Conversation
Signed-off-by: Ashing Zheng <axingfly@gmail.com>
Signed-off-by: Ashing Zheng <axingfly@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the traffic-split plugin implementation to use upstream IDs instead of inline upstream objects, improving the dataplane configuration structure. The change ensures that upstreams are properly referenced by ID in traffic-split configurations while maintaining separate upstream definitions.
- Replace inline upstream objects with upstream_id references in traffic-split plugin
- Add proper upstream naming and ID generation for backend references
- Update Service struct to include an Upstreams field for managing multiple upstream definitions
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/adc/translator/httproute.go | Adds upstream naming/ID generation and uses upstream_id in traffic-split configurations |
| internal/adc/translator/apisixroute.go | Updates ApisixRoute translator to use upstream_id references and proper naming |
| api/v2/shared_types.go | Adds utility functions for composing upstream names |
| api/adc/types.go | Adds Upstreams field to Service struct |
| api/adc/zz_generated.deepcopy.go | Generated deep copy methods for new Upstreams field |
| .github/workflows/apisix-e2e-test.yml | Sets ADC_VERSION environment variable |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Signed-off-by: Ashing Zheng <axingfly@gmail.com>
bzp2010
left a comment
There was a problem hiding this comment.
Are our tests based on the final results? Do they not need to be modified to verify the changes in the pull request?
The current test should be sufficient. If necessary, we can consider creating a new issue to track some more detailed assertions in the test.
|
Type of change:
What this PR does / why we need it:
ref: #2540 (comment)
In the traffic-split plugin, use upstream_id to replace inline upstream.
Pre-submission checklist: