gateway-api: fix supported route kind validation#870
Merged
arkodg merged 1 commit intoenvoyproxy:mainfrom Jan 6, 2023
Merged
Conversation
The logic for validating `allowedRoute.kinds` of a listener was overwriting the SupportedKinds when multiple kinds are configured. This caused the `GatewayInvalidRouteKind` conformance test to fail. Items addressed: - refactored `validateAllowedRoutes` to reduce nesting - fixed `validateAllowedRoutes` logic so it collects all of the SupportedKinds before setting them on the listener - provide additional context to user to help identify which RouteKind is invalid on a listener - updated unit tests for translator based on new expected output - added additional unit test case for translator to test for when multiple Kinds are added which includes valid and invalid Kinds. Signed-off-by: Lance Austin <laustin@datawire.io>
Codecov Report
@@ Coverage Diff @@
## main #870 +/- ##
==========================================
- Coverage 63.93% 63.85% -0.09%
==========================================
Files 51 51
Lines 6863 6869 +6
==========================================
- Hits 4388 4386 -2
- Misses 2201 2206 +5
- Partials 274 277 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The logic for validating
allowedRoute.kindsof a listener was overwriting the SupportedKinds when multiple kinds are configured. This caused theGatewayInvalidRouteKindconformance test to fail.Items addressed:
validateAllowedRoutesto reduce nestingvalidateAllowedRouteslogic so it collects all of the SupportedKinds before setting them on the listenerFixes #782