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

feat(translator): Implement BTP CircuitBreaker API #2330

Merged
merged 5 commits into from
Dec 21, 2023

Conversation

guydc
Copy link
Contributor

@guydc guydc commented Dec 20, 2023

What type of PR is this?
Feature, implementation of API defined in #2284

What this PR does / why we need it:
Add support for configuring Envoy's circuit breaking settings.

Which issue(s) this PR fixes:
Fixes #2125

@guydc guydc requested a review from a team as a code owner December 20, 2023 19:57
Copy link

codecov bot commented Dec 20, 2023

Codecov Report

Attention: 37 lines in your changes are missing coverage. Please review.

Comparison is base (a4f0396) 64.72% compared to head (9835925) 64.71%.

Files Patch % Lines
internal/ir/zz_generated.deepcopy.go 0.00% 28 Missing and 1 partial ⚠️
internal/gatewayapi/backendtrafficpolicy.go 85.18% 6 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2330      +/-   ##
==========================================
- Coverage   64.72%   64.71%   -0.01%     
==========================================
  Files         113      113              
  Lines       16445    16557     +112     
==========================================
+ Hits        10644    10715      +71     
- Misses       5130     5168      +38     
- Partials      671      674       +3     

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

}

func setCircuitBreakerPolicyErrorCondition(policy *egv1a1.BackendTrafficPolicy) {
message := "Unable to translate Circuit Breaker"
Copy link
Contributor

Choose a reason for hiding this comment

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

can we pass an extra errMsg to the func to add some more error msg details such as invalid maxPendingRequests value etc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@arkodg
Copy link
Contributor

arkodg commented Dec 20, 2023

the PR is looking really good, thanks for adding an e2e as well !
added a minor comment around err message verbosity in the policy status

Copy link
Contributor

@shawnh2 shawnh2 left a comment

Choose a reason for hiding this comment

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

some nits, lgtm, thanks

internal/gatewayapi/backendtrafficpolicy.go Show resolved Hide resolved
}

if pcb.MaxParallelRequests != nil {
if ui32, ok := int64ToUint32(*pcb.MaxParallelRequests); ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add some test here? make sure int64ToUint32 works as expected

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Xunzhuo
Xunzhuo previously approved these changes Dec 21, 2023
Copy link
Member

@Xunzhuo Xunzhuo left a comment

Choose a reason for hiding this comment

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

Thanks, this PR overall looks good ! Pretty clear. Would love to add more e2e tests and a user guide docs in a follow-up.

Signed-off-by: Guy Daich <guy.daich@sap.com>
Signed-off-by: Guy Daich <guy.daich@sap.com>
Signed-off-by: Guy Daich <guy.daich@sap.com>
Signed-off-by: Guy Daich <guy.daich@sap.com>
Signed-off-by: Guy Daich <guy.daich@sap.com>
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 merged commit b6f4306 into envoyproxy:main Dec 21, 2023
15 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.

Support Circuit Breaker
5 participants