Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(traffic-split): upstream_obj.upstream should not be a string #11932

Merged
merged 3 commits into from
Jan 22, 2025

Conversation

shreemaan-abhishek
Copy link
Contributor

@shreemaan-abhishek shreemaan-abhishek commented Jan 22, 2025

Description

During creation of roundrobin object for upstream in traffic-split. upstream_obj.upstream: 1 is assigned a string if the upstream configuration only has the weight value.

In this case, if we reload the plugin via the plugin reload API. The roundrobin object gets recreated but since upstream_obj.upstream has a string value. upstream_obj.upstream.vid = i: 2 causes panic because it expects upstream_obj to be a table.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@shreemaan-abhishek shreemaan-abhishek marked this pull request as ready for review January 22, 2025 04:54
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Jan 22, 2025
@nic-chen nic-chen merged commit 0cb7d9a into apache:master Jan 22, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants