-
Notifications
You must be signed in to change notification settings - Fork 593
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(log): do not parse error body when response is empty in reloading config #4666
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #4666 +/- ##
=====================================
Coverage 67.8% 67.8%
=====================================
Files 164 164
Lines 19284 19289 +5
=====================================
+ Hits 13077 13092 +15
+ Misses 5435 5426 -9
+ Partials 772 771 -1
☔ View full report in Codecov by Sentry. |
def00be
to
5118c3a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we best add a test case to https://github.com/Kong/kubernetes-ingress-controller/blob/56a11b9e99253fe1c0d43174173b553126cb4cc0/internal/dataplane/sendconfig/error_handling_test.go for this. WDYT?
Added unit test. |
BTW: when does |
one situation: When |
What this PR does / why we need it:
When Kong client fails to get response from reloading declarative configuration (
POST /config
), do not parse the error body and directly return the error for not getting response, to produce less misleading error log (thancould not unmarshal config error: unexpected end of JSON input
) for the situations.Which issue this PR fixes:
fixes #4665
Special notes for your reviewer:
PR Readiness Checklist:
Complete these before marking the PR as
ready to review
:CHANGELOG.md
release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR