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 upstream discovery args metadata field caused crash. #2832

Merged

Conversation

tsuijie
Copy link
Contributor

@tsuijie tsuijie commented Jun 29, 2023

Please answer these questions before submitting a pull request, or your PR will get closed.

Why submit this pull request?

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches

What changes will this PR take into?

Apisix and Apisix-seed support configuration of auto-discovery via Nacos with metadata field, which is an object instead of string, thus adding metadata field to discovery_args will cause apisix-dashboard to crash and unable to restart.
Error log message:
ERROR store/store.go:405 json unmarshal failed: json: cannot unmarshal object into Go struct field Upstream.discovery_args of type string

Related issues

None.

Checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • [] Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@codecov-commenter
Copy link

codecov-commenter commented Jun 30, 2023

Codecov Report

Merging #2832 (21332ca) into master (e0290c8) will decrease coverage by 6.23%.
The diff coverage is n/a.

❗ Current head 21332ca differs from pull request most recent head 9ed6215. Consider uploading reports for the commit 9ed6215 to get more accurate results

@@            Coverage Diff             @@
##           master    #2832      +/-   ##
==========================================
- Coverage   77.49%   71.27%   -6.23%     
==========================================
  Files         139      198      +59     
  Lines        3746     7763    +4017     
  Branches      881      877       -4     
==========================================
+ Hits         2903     5533    +2630     
- Misses        843     1920    +1077     
- Partials        0      310     +310     
Flag Coverage Δ
backend-e2e-test-ginkgo 65.12% <ø> (?)
backend-unit-test 49.95% <ø> (?)
frontend-e2e-test 70.35% <ø> (-7.15%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
api/internal/core/entity/entity.go 90.90% <ø> (ø)

... and 76 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@khanhngobackend
Copy link

This is very beneficial for developing/testing custom discovery plugins. Please have a look guys.

@Baoyuantop Baoyuantop merged commit e8bc9b9 into apache:master Aug 7, 2023
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants