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

refactor: error processing for xPolicy #3302

Merged
merged 8 commits into from May 23, 2024
Merged

Conversation

shawnh2
Copy link
Contributor

@shawnh2 shawnh2 commented Apr 29, 2024

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #2894, separated from #2926

Signed-off-by: shawnh2 <shawnhxh@outlook.com>
Signed-off-by: shawnh2 <shawnhxh@outlook.com>
@shawnh2 shawnh2 requested a review from a team as a code owner April 29, 2024 08:50
@shawnh2
Copy link
Contributor Author

shawnh2 commented Apr 29, 2024

/retest

@@ -1015,20 +1016,23 @@ func (t *Translator) buildCircuitBreaker(policy *egv1a1.BackendTrafficPolicy) (*

func (t *Translator) buildTimeout(policy *egv1a1.BackendTrafficPolicy, r *ir.HTTPRoute) (*ir.Timeout, error) {
var (
tto *ir.TCPTimeout
hto *ir.HTTPTimeout
tto *ir.TCPTimeout
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signed-off-by: shawnh2 <shawnhxh@outlook.com>
Signed-off-by: shawnh2 <shawnhxh@outlook.com>
if to, err = t.buildTimeout(policy, r); err != nil {
return errors.Wrap(err, "Timeout")
if to, err = t.buildTimeout(policy, r); err == nil {
r.Timeout = to
Copy link
Contributor Author

@shawnh2 shawnh2 May 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stop warpping error with message here to prevent the error returned by buildTimeout got surfaced again.

arkodg
arkodg previously approved these changes May 20, 2024
Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks !

@arkodg arkodg requested review from a team May 20, 2024 23:27
Xunzhuo
Xunzhuo previously approved these changes May 22, 2024
Signed-off-by: shawnh2 <shawnhxh@outlook.com>
Signed-off-by: shawnh2 <shawnhxh@outlook.com>
@shawnh2 shawnh2 dismissed stale reviews from Xunzhuo and arkodg via f4b0742 May 23, 2024 03:42
@shawnh2 shawnh2 requested review from arkodg and Xunzhuo May 23, 2024 03:44
Copy link

codecov bot commented May 23, 2024

Codecov Report

Attention: Patch coverage is 75.69444% with 35 lines in your changes are missing coverage. Please review.

Project coverage is 67.22%. Comparing base (99f9132) to head (f4b0742).

Files Patch % Lines
internal/gatewayapi/backendtrafficpolicy.go 79.76% 14 Missing and 3 partials ⚠️
internal/gatewayapi/clienttrafficpolicy.go 66.66% 7 Missing and 1 partial ⚠️
internal/gatewayapi/envoyextensionpolicy.go 74.07% 5 Missing and 2 partials ⚠️
internal/gatewayapi/securitypolicy.go 50.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3302      +/-   ##
==========================================
- Coverage   67.23%   67.22%   -0.01%     
==========================================
  Files         166      166              
  Lines       19439    19489      +50     
==========================================
+ Hits        13070    13102      +32     
- Misses       5424     5439      +15     
- Partials      945      948       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks !

@arkodg arkodg merged commit cffaf27 into envoyproxy:main May 23, 2024
22 of 23 checks passed
@shawnh2 shawnh2 deleted the xpolicy-err branch May 24, 2024 06:56
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.

Unify the way to process errors for xPolicy
4 participants