gateway icon indicating copy to clipboard operation
gateway copied to clipboard

refactor: return 500 when BackendTLSPolicy translation fails

Open alexwo opened this issue 1 year ago • 13 comments

What type of PR is this?

What this PR does / why we need it:

  • 500 for HTTP
  • connection reset for TCP/UDP

Which issue(s) this PR fixes: Fixes https://github.com/envoyproxy/gateway/issues/4087

alexwo avatar Sep 29 '24 12:09 alexwo

Codecov Report

Attention: Patch coverage is 81.62162% with 34 lines in your changes missing coverage. Please review.

Project coverage is 66.28%. Comparing base (b9f9a9f) to head (c2c8b4b). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/gatewayapi/route.go 75.00% 16 Missing and 5 partials :warning:
internal/gatewayapi/filters.go 63.63% 7 Missing and 1 partial :warning:
internal/gatewayapi/ext_service.go 40.00% 2 Missing and 1 partial :warning:
internal/gatewayapi/validate.go 95.55% 2 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4363      +/-   ##
==========================================
- Coverage   66.29%   66.28%   -0.01%     
==========================================
  Files         209      209              
  Lines       31912    31956      +44     
==========================================
+ Hits        21157    21183      +26     
- Misses       9507     9523      +16     
- Partials     1248     1250       +2     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Sep 29 '24 12:09 codecov[bot]

/retest

alexwo avatar Sep 29 '24 18:09 alexwo

/retes

alexwo avatar Oct 01 '24 10:10 alexwo

/retest

alexwo avatar Oct 01 '24 10:10 alexwo

/retest

alexwo avatar Oct 01 '24 10:10 alexwo

/retest

alexwo avatar Oct 02 '24 16:10 alexwo

/retest

alexwo avatar Oct 08 '24 14:10 alexwo

@alexwo I dont see the conformance tests passing. I'm worried about the size of this change that not only applies to BTP but every error while translating route rules and backendRefs. For example if one out of the many backendRefs is invalid, only a portion of the requests should receive a 503 https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io%2fv1.HTTPBackendRef

arkodg avatar Oct 17 '24 21:10 arkodg

@alexwo I dont see the conformance tests passing. I'm worried about the size of this change that not only applies to BTP but every error while translating route rules and backendRefs. For example if one out of the many backendRefs is invalid, only a portion of the requests should receive a 503 https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io%2fv1.HTTPBackendRef

@arkodg indeed, the impact of the change is large and it will render out many of the partial working, not fully configured routes, I can fully relate to it.

We should be covered as long as many of the necessary tests should be in place,what can detect potential issues.

The conformance tests are passing, but there was a linting issue previously that prevented them from running.

Now, if a part of the backend reference configuration is invalid — for example, if one of the associated configurations cannot be processed — the key question is: should routing to this backend reference still occur in such cases?

alexwo avatar Oct 18 '24 08:10 alexwo

/retest

alexwo avatar Oct 18 '24 13:10 alexwo

Now, if a part of the backend reference configuration is invalid — for example, if one of the associated configurations cannot be processed — the key question is: should routing to this backend reference still occur in such cases?

According to the spec, the answer is a portion of the requests (based on weights) should continue to be sent to the valid backendRef

arkodg avatar Oct 18 '24 22:10 arkodg

Now, if a part of the backend reference configuration is invalid — for example, if one of the associated configurations cannot be processed — the key question is: should routing to this backend reference still occur in such cases?

According to the spec, the answer is a portion of the requests (based on weights) should continue to be sent to the valid backendRef

We’re processing all backend routes and addressing only falty configured ones. This should ensures alignment with the spec, as valid backend routes will continue to function, while only those with invalid configurations will be skipped / not translated. ( we process all routes for each backend and go over all routes, even if some one the backend routes did have errors . )

alexwo avatar Oct 19 '24 09:10 alexwo

/retest

alexwo avatar Oct 20 '24 10:10 alexwo

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, when it's ready. Thank you for your contributions!

github-actions[bot] avatar Nov 19 '24 12:11 github-actions[bot]

/retest

alexwo avatar Dec 07 '24 21:12 alexwo

/retest

alexwo avatar Dec 07 '24 21:12 alexwo

/retest

alexwo avatar Dec 07 '24 21:12 alexwo

/retest

alexwo avatar Dec 08 '24 05:12 alexwo